/* =========================================================
   Novelinsta prototype — visual shell and interactive screens
   ========================================================= */
:root {
  --bg: #05030c;
  --bg-2: #120824;
  --panel: rgba(24, 12, 43, 0.72);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(184, 126, 255, 0.22);
  --accent: #8c42ff;
  --accent-2: #c57cff;
  --text: #ffffff;
  --muted: #a99ac6;
  --phone-w: min(430px, 92vw);
  --phone-ratio: 0.5628; /* generated screens are close to 9:16 */
  --phone-h: calc(var(--phone-w) / var(--phone-ratio));
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(141, 65, 255, 0.22), transparent 34%),
    radial-gradient(circle at 83% 74%, rgba(92, 31, 180, 0.26), transparent 36%),
    linear-gradient(135deg, #04020a 0%, #0b0517 45%, #05030c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 78%);
}

.prototype-shell {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(320px, 560px) minmax(190px, 260px);
  gap: 32px;
  align-items: center;
  justify-content: center;
  padding: 42px 34px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: panelIn 900ms ease both;
}

.side-panel-right { animation-delay: 120ms; }

.brand-card,
.hint-card,
.screen-nav {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(35, 17, 62, 0.82), rgba(10, 5, 22, 0.58));
  border-radius: 28px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(18px);
}

.brand-card {
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #5e23ca);
  box-shadow: 0 0 36px rgba(140, 66, 255, 0.55);
  font-size: 24px;
}

.brand-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.brand-card p,
.hint-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.hint-card {
  position: relative;
  padding: 18px 18px 18px 48px;
}

.hint-dot {
  position: absolute;
  left: 20px;
  top: 23px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #a755ff;
  box-shadow: 0 0 22px #a755ff;
  animation: pulse 1.8s ease-in-out infinite;
}

.nav-title {
  padding: 0 6px;
  color: #e9ddff;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.screen-nav {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-nav button,
.mobile-toolbar button {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  transition: 220ms ease;
}

.screen-nav button:hover,
.screen-nav button.is-active,
.mobile-toolbar button.is-active {
  color: white;
  border-color: rgba(185, 117, 255, 0.35);
  background: linear-gradient(135deg, rgba(143, 68, 255, 0.28), rgba(255, 255, 255, 0.055));
  box-shadow: 0 0 28px rgba(141, 65, 255, 0.18);
}

.phone-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}

.device-glow {
  position: absolute;
  width: calc(var(--phone-w) * 1.16);
  height: calc(var(--phone-h) * 1.03);
  border-radius: 52px;
  background: radial-gradient(circle at 50% 16%, rgba(178, 101, 255, 0.32), transparent 36%), radial-gradient(circle at 50% 78%, rgba(94, 37, 207, 0.38), transparent 46%);
  filter: blur(34px);
  opacity: 0.9;
  animation: glowFloat 4.6s ease-in-out infinite;
}

.device {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  border-radius: 44px;
  padding: 10px;
  background: linear-gradient(145deg, #1b1230, #05030a 54%, #2a1450);
  box-shadow:
    0 60px 140px rgba(0,0,0,0.58),
    0 0 0 1px rgba(255,255,255,0.08),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.8);
  animation: phoneIn 900ms cubic-bezier(.2,.9,.2,1) both;
}

.device-top {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.speaker {
  width: 118px;
  height: 31px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.64);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: inset 0 2px 10px rgba(255,255,255,0.04), 0 10px 28px rgba(0,0,0,0.34);
  opacity: 0.68;
}

.app-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 36px;
  background: #090511;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.screen-layer {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 1;
  transform: scale(1);
  transition: opacity 420ms ease, transform 580ms cubic-bezier(.2,.9,.2,1), filter 420ms ease;
}

.screen-layer.is-leaving {
  opacity: 0;
  transform: scale(1.035);
  filter: blur(12px);
}

.touch-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.hotspot {
  position: absolute;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 22px;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.hotspot:focus-visible,
.hotspot:hover {
  background: rgba(164, 87, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(198, 127, 255, 0.28), 0 0 24px rgba(164, 87, 255, 0.18);
  outline: none;
}

.transition-flare {
  position: absolute;
  inset: auto auto 38px 50%;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #b766ff;
  transform: translateX(-50%) scale(0);
  box-shadow: 0 0 60px 34px rgba(183, 102, 255, 0.35);
  z-index: 4;
  pointer-events: none;
}

.transition-flare.is-active { animation: flare 560ms ease both; }

.mobile-toolbar {
  display: none;
}

@keyframes phoneIn {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glowFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: .76; }
  50% { transform: translateY(-10px) scale(1.02); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(.9); opacity: .72; }
  50% { transform: scale(1.18); opacity: 1; }
}

@keyframes flare {
  0% { transform: translateX(-50%) scale(0); opacity: 0; }
  42% { opacity: 1; }
  100% { transform: translateX(-50%) scale(34); opacity: 0; }
}

@media (max-width: 1040px) {
  .prototype-shell {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px 18px 96px;
  }

  .side-panel {
    display: none;
  }

  .mobile-toolbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 20;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(12, 6, 25, 0.8);
    backdrop-filter: blur(18px);
  }

  .mobile-toolbar button {
    white-space: nowrap;
    text-align: center;
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  :root { --phone-w: min(390px, 96vw); }
  .prototype-shell { padding-left: 8px; padding-right: 8px; }
}
