/* Full-size example viewer: a thin bar to switch projects and builders, the site below. */
:root {
  --bar: #05070a;
  --bar-line: rgba(255, 255, 255, 0.09);
  --ink: #f7f4ee;
  --muted: #aab1bd;
  --accent: #2f74ff;
  --pill: rgba(255, 255, 255, 0.06);
  --pill-hover: rgba(255, 255, 255, 0.12);
  --focus: #f0b92c;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bar);
  color: var(--ink);
  font-family: var(--sans);
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.viewer-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.viewer-bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--bar-line);
  background: var(--bar);
}

.viewer-bar button,
.viewer-bar select {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
}

.viewer-bar button:focus-visible,
.viewer-bar select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.viewer-back {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.viewer-back:hover { background: rgba(255, 255, 255, 0.11); }
.viewer-back:active { transform: translateY(1px); }
.viewer-back span[aria-hidden] { font-size: 16px; }

.viewer-projects {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.viewer-projects button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.viewer-projects button small {
  padding-top: 1px;
  color: rgba(170, 177, 189, 0.7);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.viewer-projects button:hover { background: var(--pill); color: var(--ink); }

.viewer-projects button {
  border-radius: 0 !important;
  border-bottom: 2px solid transparent !important;
}

.viewer-projects button:hover { background: transparent; }

.viewer-projects button[aria-selected="true"] {
  border-bottom-color: var(--accent) !important;
  color: var(--ink);
}

.viewer-projects button[aria-selected="true"] small { color: #8fb2ff; }

.viewer-pick { display: none; flex: 1 1 auto; min-width: 0; }

.viewer-pick select {
  width: 100%;
  padding: 0 30px 0 12px;
  background: var(--pill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23aab1bd' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
}

.rocker {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
}

.rocker-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.rocker-side { position: relative; color: var(--muted); cursor: pointer; }
.rocker-side input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rocker-side:has(input:checked) { color: var(--ink); }
.rocker-side:has(input:focus-visible) span { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.rocker-track {
  position: relative;
  width: 44px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(47, 116, 255, 0.35);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.rocker-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  transition: transform 0.22s cubic-bezier(0.3, 1.3, 0.5, 1);
}

.rocker[data-side="claude"] .rocker-knob { transform: translateX(20px); }

.viewer-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
}

.viewer-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.viewer-loading {
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
}

.viewer-stage[data-loading="true"] .viewer-loading {
  opacity: 1;
  animation: viewer-sweep 1.1s ease-in-out infinite;
}

@keyframes viewer-sweep {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}

.viewer-noscript {
  padding: 24px;
  color: #111;
}

@media (max-width: 860px) {
  .viewer-projects button small { display: none; }
  .viewer-projects button { padding: 0 11px; }
}

@media (max-width: 680px) {
  .viewer-bar { gap: 8px; }
  .viewer-projects { display: none; }
  .viewer-pick { display: block; }
  .viewer-back { padding: 0 11px; }
  .viewer-back-label { display: none; }
  .rocker-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rocker-knob { transition: none; }
  .viewer-stage[data-loading="true"] .viewer-loading { animation: none; opacity: 0.6; background-position: 50% 0; }
}
