/* Prototype runner for the design case studies (see proto.js). */
:root {
  --brand: #4f46e5;
  --brand-soft: rgba(79, 70, 229, 0.14);
  --bg: #eef0f5;
  --panel: #ffffff;
  --text: #171a21;
  --muted: #5d6675;
  --line: #e2e6ee;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1117;
  --panel: #171a23;
  --text: #eef0f4;
  --muted: #a3abb8;
  --line: rgba(255, 255, 255, 0.09);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(50% 45% at 15% 15%, var(--brand-soft), transparent 70%),
    radial-gradient(45% 40% at 90% 85%, var(--brand-soft), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }

.proto { display: grid; grid-template-columns: 300px 1fr; height: 100%; }
.proto-side {
  padding: 26px 22px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 75%, transparent);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}
.proto-side h1 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.proto-side .kind { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }
.proto-side p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.proto-steps { display: grid; gap: 4px; }
.proto-steps button {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 8px 10px; border-radius: 10px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500;
}
.proto-steps button:hover { background: var(--brand-soft); color: var(--text); }
.proto-steps button.on { background: var(--brand); color: #fff; }
.proto-steps button i { font-style: normal; font-size: 11px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--text); flex-shrink: 0; }
.proto-steps button.on i { background: rgba(255, 255, 255, 0.25); color: #fff; }
.proto-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.proto-tools button { font-size: 12.5px; font-weight: 500; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.proto-tools button.on { background: var(--brand); color: #fff; border-color: transparent; }
.proto-hint { font-size: 12px; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); }

.proto-stage { display: flex; align-items: center; justify-content: center; padding: 20px; min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.proto-screen { position: relative; height: min(100%, 860px); aspect-ratio: var(--ratio, 0.52); max-width: 100%; }
.proto-screen > img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 24px 40px rgba(16, 24, 40, 0.22)); }
.proto-screen .hot {
  position: absolute; border: 0; background: transparent; border-radius: 10px; padding: 0;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.proto-screen .hot:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.proto-screen.show-hot .hot,
.proto-screen.flash .hot { background: rgba(79, 124, 255, 0.22); box-shadow: 0 0 0 2px rgba(79, 124, 255, 0.85); }
.proto-screen.flash .hot { animation: proto-flash 0.9s ease-out; }
@keyframes proto-flash { 0% { opacity: 1; } 100% { opacity: 0; } }
.proto-screen.flash.show-hot .hot { animation: none; }

/* Coded (HTML) screens get a drawn phone frame */
.proto-phone {
  position: relative; width: 100%; height: 100%;
  border-radius: 46px; padding: 12px; background: #15171c;
  box-shadow: 0 0 0 2px #3a3d45, 0 24px 50px rgba(16, 24, 40, 0.3);
}
.proto-phone::before { content: ""; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 34%; height: 24px; background: #15171c; border-radius: 0 0 16px 16px; z-index: 3; }
.proto-phone .app { position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden; background: #fff; color: #1d1d1d; display: flex; flex-direction: column; }

.proto-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 14px);
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; padding: 9px 16px; border-radius: 999px;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 20; max-width: calc(100% - 32px); text-align: center;
}
.proto-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .proto { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .proto-side { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .proto-side .kind, .proto-side p, .proto-side h1, .proto-hint { display: none; }
  .proto-steps { display: flex; gap: 4px; }
  .proto-steps button { white-space: nowrap; padding: 6px 9px; font-size: 12px; }
  .proto-steps button span { display: none; }
  .proto-steps button.on span { display: inline; }
  .proto-tools { flex-wrap: nowrap; margin-left: auto; }
  .proto-tools button { white-space: nowrap; }
  .proto-tools [data-tool="hot"] { display: none; }
  .proto-stage { padding: 10px; }
}
