:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink: #111;
  --ink-2: rgba(0, 0, 0, 0.55);
  --hairline: rgba(0, 0, 0, 0.08);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #fff;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- chrome ---------- */

.mark {
  position: fixed;
  top: 30px;
  left: 34px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  user-select: none;
  z-index: 3;
  transition: opacity 0.5s ease;
}

.foot {
  position: fixed;
  bottom: 26px;
  left: 34px;
  right: 34px;
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(0, 0, 0, 0.3);
  z-index: 3;
  transition: opacity 0.5s ease;
}

.foot__mail {
  color: rgba(0, 0, 0, 0.3);
  text-decoration: none;
  transition: color 0.25s ease;
}
.foot__mail:hover { color: var(--ink); }

body[data-open] .mark,
body[data-open] .foot {
  opacity: 0.12;
  pointer-events: none;
}

/* ---------- dots ---------- */

.dots {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, auto);
  place-content: center;
  column-gap: clamp(70px, 14vw, 190px);
  row-gap: clamp(60px, 13vh, 150px);
  z-index: 2;
  transition: opacity 0.45s ease;
}

.dots[data-quiet] {
  opacity: 0;
  pointer-events: none;
}

.dot {
  position: relative;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c, var(--ink));
  transform: translate(-50%, -50%);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), background-color 0.6s ease;
}

/* breathing ring */
.dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  border: 1px solid var(--c, var(--ink));
  opacity: 0;
  animation: dot-ring 3.2s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
  animation-delay: var(--d, 0s);
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

@keyframes dot-ring {
  0%   { transform: scale(0.6); opacity: 0; }
  12%  { opacity: 0.45; }
  70%  { transform: scale(3.1); opacity: 0; }
  100% { transform: scale(3.1); opacity: 0; }
}

.dot:hover::before,
.dot:focus-visible::before {
  transform: translate(-50%, -50%) scale(1.55);
}

.dot:focus { outline: none; }
.dot:focus-visible::after {
  animation: none;
  opacity: 0.5;
  transform: scale(2.2);
}

@media (prefers-reduced-motion: reduce) {
  .dot::after { animation: none; opacity: 0.25; transform: scale(1.8); }
}

/* ---------- panel ---------- */

.panel {
  position: fixed;
  inset: 0;
  z-index: 4;
  visibility: hidden;
  pointer-events: none;
}

.panel[data-shown] { visibility: visible; }

.panel__window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 24px 80px -24px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.03);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: auto;
  overflow: hidden;
}

.panel[data-shown] .panel__window { opacity: 1; }
.panel[data-closing] .panel__window { opacity: 0; transition-duration: 0.22s; }

.panel__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 48px;
  padding: 0 10px 0 22px;
  border-bottom: 1px solid var(--hairline);
  flex: none;
  user-select: none;
}

.panel__index {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.panel__name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel__kind {
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  flex: 1;
}

.panel__close {
  width: 38px;
  height: 38px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 22px;
  font-weight: 200;
  line-height: 1;
  color: var(--ink);
  opacity: 0.35;
  border-radius: 50%;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

.panel__close:hover,
.panel__close:focus-visible {
  opacity: 1;
  transform: rotate(90deg);
}
.panel__close:focus { outline: none; }

.panel__body {
  flex: 1;
  min-height: 0;
  position: relative;
  /* inert until the mock is actually revealed */
  pointer-events: none;
}

.panel[data-live] .panel__body { pointer-events: auto; }

/* host slot for real embedded apps: lives outside .panel__body so it is
   never torn down on close — the app keeps its session between visits */
.app-host {
  position: absolute;
  top: 48px; /* below the bar */
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  z-index: 1; /* above the body, below the reveal veil */
  pointer-events: none;
}

.app-host iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.panel[data-live] .app-host { pointer-events: auto; }

.panel__body > div { position: absolute; inset: 0; }

.panel__cover {
  position: absolute;
  inset: 0;
  background: #fff;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: opacity 0.55s ease;
  z-index: 2;
}

.panel__cover canvas { width: 100%; height: 100%; display: block; }

.panel[data-live] .panel__cover { opacity: 0; pointer-events: none; }
.panel[data-closing] .panel__cover { opacity: 1; transition-duration: 0.2s; }
