/* =========================================================================
   Bloom demo · all visual styling
   JS only mutates: frame.style.{width, height, left, top}
   and the canvas drawing surface.
   ========================================================================= */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  font-family: -apple-system, system-ui, "Segoe UI", sans-serif;
}

/* Solo page (index.html): only the click-to-bloom stage, on a seamless
   black background so it embeds cleanly (e.g. inside Framer). */
body.solo {
  background: #000;
  padding: 0;
}

/* ---- Layout ---- */
.row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.card {
  background: #ebeae3;
  border-radius: 18px;
  padding: 24px 24px 20px;
  width: 600px;
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.card__head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #444;
}

.card__tag {
  font-size: 10px;
  color: #888;
  font-family: ui-monospace, Menlo, monospace;
}

.card__desc {
  font-size: 12px;
  color: #777;
  margin: 0 0 20px;
  line-height: 1.5;
  min-height: 50px;
}

/* ---- Stage (the dark backdrop the frame lives in) ---- */
.stage {
  width: 540px;
  height: 540px;
  background: #000;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}
.stage--centered {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Frame (base) ---- */
.frame {
  background: #000;
  overflow: hidden;
  user-select: none;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  position: relative;
}

.frame__canvas {
  display: block;
  pointer-events: none;
  position: absolute;
}

/* Option 1: canvas fills frame from origin */
.frame--locked .frame__canvas { left: 0; top: 0; }

/* Option 2: movable mask window */
.frame--mask {
  position: absolute;
  cursor: grab;
}
.frame--mask:active { cursor: grabbing; }

/* Option 3: clickable bloom button */
.frame--button {
  position: absolute;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.frame--button:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.4),
    0 0 24px rgba(140, 120, 200, 0.25);
}

/* ---- 8-way resize handles ---- */
.rh { position: absolute; z-index: 6; }

/* edges */
.rh--n { top: -3px;    left: 14px;  right: 14px; height: 8px; cursor: ns-resize; }
.rh--s { bottom: -3px; left: 14px;  right: 14px; height: 8px; cursor: ns-resize; }
.rh--w { top: 14px; bottom: 14px;   left: -3px;  width: 8px;  cursor: ew-resize; }
.rh--e { top: 14px; bottom: 14px;   right: -3px; width: 8px;  cursor: ew-resize; }

/* corners */
.rh--nw { top: -4px;    left: -4px;   width: 16px; height: 16px;
          cursor: nwse-resize; z-index: 7; }
.rh--ne { top: -4px;    right: -4px;  width: 16px; height: 16px;
          cursor: nesw-resize; z-index: 7; }
.rh--sw { bottom: -4px; left: -4px;   width: 16px; height: 16px;
          cursor: nesw-resize; z-index: 7; }
.rh--se { bottom: -4px; right: -4px;  width: 16px; height: 16px;
          cursor: nwse-resize; z-index: 7; }

/* L-shaped marker on each corner */
.rh--nw::before, .rh--ne::before, .rh--sw::before, .rh--se::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-color: rgba(255, 255, 255, 0.6);
  border-style: solid;
}
.rh--nw::before { left:  4px; top:    4px; border-width: 1.2px 0 0 1.2px; }
.rh--ne::before { right: 4px; top:    4px; border-width: 1.2px 1.2px 0 0; }
.rh--sw::before { left:  4px; bottom: 4px; border-width: 0 0 1.2px 1.2px; }
.rh--se::before { right: 4px; bottom: 4px; border-width: 0 1.2px 1.2px 0; }

/* ---- Readout / progress ---- */
.readout {
  margin-top: 14px;
  font-size: 11px;
  font-family: ui-monospace, Menlo, monospace;
  color: #888;
  letter-spacing: 0.02em;
}

.progress {
  height: 2px;
  background: #d6d3c8;
  border-radius: 1px;
  margin-top: 6px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: #6b5fa3;
  width: 0;
  transition: width 0.05s linear;
}
