/* ═══════════════════════════════════════════════════════════════════════════
   MARBLELENS · CREATE — CHOOSE / PLACE / LOCK / COMPLETE
   The real commercial entry point (§31–33), not a decorative form.

   The rule that governs every choice here: ACCESSIBILITY AND USABILITY BEAT
   SPECTACLE (§32). So the flow is real fieldsets, real labels, real radios and
   checkboxes with visible focus — and the "assembly" is what those controls
   drive, never a replacement for them. Each decision mounts a labelled paper
   piece on the board at the side; by the review step the project physically
   exists in front of the visitor.
   ═══════════════════════════════════════════════════════════════════════════ */

.create-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start;
}

/* ── THE FLOW SHEET ────────────────────────────────────────────────────────*/
.create-flow {
  position: relative; background: var(--paper-hi);
  border: 1px solid var(--line); box-shadow: var(--sh-lift);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 2.4rem);
  min-height: 30rem;
}

/* progress — printed ticks, not a SaaS stepper bar */
.cprog { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; list-style: none;
  margin: 0 0 var(--s-5); padding: 0 0 var(--s-4);
  border-bottom: 1px solid var(--line); }
.cprog li {
  display: flex; align-items: center; gap: 0.45em;
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--graphite-2);
}
.cprog li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid currentColor; transition: all var(--dur-fast) var(--ease-out);
}
.cprog li.done { color: var(--graphite); }
.cprog li.done::before { background: var(--graphite); border-color: var(--graphite); }
.cprog li.now { color: var(--accent-ink); }
.cprog li.now::before { background: var(--accent); border-color: var(--accent); transform: scale(1.35); }

/* a step arrives as a fresh sheet placed on the pile — stepped, with weight */
.cstep { animation: placeStep 0.34s steps(4, end) both; }
@keyframes placeStep {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.cstep-h { font-family: var(--serif); font-weight: 600; font-size: var(--t-h3);
  color: var(--ink); margin: 0 0 var(--s-2); }
.cstep-sub { font-size: var(--t-small); color: var(--graphite); max-width: 46ch;
  margin-bottom: var(--s-5); }
.cstep fieldset { border: 0; margin: 0; padding: 0; }
.cstep legend { padding: 0; }

/* ── CHOICE CARDS · real radios/checkboxes wearing paper ───────────────────
   The input stays in the DOM and keeps its native semantics and keyboard
   behaviour; only its appearance is the studio's. Focus is drawn on the label
   via :focus-visible on the input, so tabbing is always visible (§41). */
.copts { display: grid; gap: var(--s-3); }
.copts.two   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.copts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .copts.two, .copts.three { grid-template-columns: 1fr; } }

.copt { position: relative; display: block; cursor: pointer; }
.copt input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.copt .face {
  display: grid; gap: 0.3em; padding: var(--s-4);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--sh-pin);
  transition: transform var(--dur-fast) var(--ease-mount),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast);
}
.copt .face b { font-family: var(--serif); font-weight: 600; font-size: 1rem; color: var(--ink); }
.copt .face span { font-size: var(--t-small); color: var(--graphite); }
.copt:hover .face { transform: translateY(-2px); box-shadow: var(--sh-mount); }
.copt input:focus-visible + .face { outline: 2px solid var(--accent); outline-offset: 3px; }
/* LOCKED — the piece is pressed down and marked, not merely highlighted */
.copt input:checked + .face {
  border-color: var(--accent); background: var(--paper-hi);
  box-shadow: var(--sh-mount), inset 0 0 0 1px var(--accent);
  transform: translateY(0);
}
.copt input:checked + .face::after {
  content: "✓"; position: absolute; top: 10px; right: 12px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--accent);
}
.copt input:disabled + .face { opacity: 0.45; cursor: not-allowed; }
.copt input:disabled ~ * { cursor: not-allowed; }

/* ── TEXT FIELDS ───────────────────────────────────────────────────────────*/
.cfields { display: grid; gap: var(--s-4); }
.cfields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .cfields.two { grid-template-columns: 1fr; } }
.cfield { display: grid; gap: 0.4em; }
.cfield label {
  font-family: var(--mono); font-size: var(--t-label);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--graphite);
}
.cfield .req { color: var(--accent-ink); }
.cfield input, .cfield textarea, .cfield select {
  font: inherit; font-size: var(--t-body); color: var(--ink);
  padding: 0.75em 0.9em; width: 100%;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--sh-press);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.cfield textarea { resize: vertical; min-height: 6.5em; line-height: 1.5; }
.cfield input:focus, .cfield textarea:focus, .cfield select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--sh-press), 0 0 0 3px var(--accent-wash);
}
.cfield .hint { font-size: 0.78rem; color: var(--graphite-2); }
.cfield.bad input, .cfield.bad textarea { border-color: var(--red); }
.cfield .err { font-size: 0.78rem; color: var(--red); min-height: 1.1em; }

/* ── CHIP LIST · pages & features, multi-select ────────────────────────────*/
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chip .face {
  display: block; padding: 0.5em 0.95em; cursor: pointer;
  font-size: var(--t-small); color: var(--ink-2);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 100px; transition: all var(--dur-fast) var(--ease-out);
}
.chip:hover .face { border-color: var(--graphite-2); }
.chip input:focus-visible + .face { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip input:checked + .face {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: var(--sh-pin);
}

/* ── NAVIGATION ────────────────────────────────────────────────────────────*/
.cnav { display: flex; align-items: center; gap: var(--s-3);
  margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.cnav .spacer { margin-left: auto; }
.cnav .btn[disabled] { opacity: 0.4; pointer-events: none; }
.cstep-note { font-size: 0.78rem; color: var(--graphite-2); margin-top: var(--s-3); }

/* ── REVIEW · the normalized project, read back ────────────────────────────*/
.creview { display: grid; gap: var(--s-3); }
.crow { display: grid; grid-template-columns: minmax(9rem, 0.32fr) 1fr;
  gap: var(--s-3); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line-2); }
.crow dt { font-family: var(--mono); font-size: var(--t-label);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--graphite); }
.crow dd { margin: 0; color: var(--ink-2); font-size: var(--t-small); }
.crow dd.empty { color: var(--graphite-2); font-style: italic; }
@media (max-width: 560px) { .crow { grid-template-columns: 1fr; gap: 0.2em; } }

/* the integration seam, stated plainly rather than faked (§31 step 7) */
.cseam {
  margin-top: var(--s-5); padding: var(--s-4);
  background: var(--paper); border: 1px dashed var(--graphite-2);
  border-radius: var(--radius-sm);
}
.cseam h4 { font-family: var(--mono); font-size: var(--t-label); font-weight: 600;
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--graphite); margin: 0 0 var(--s-2); }
.cseam p { font-size: var(--t-small); color: var(--ink-2); }
.cseam .cactions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }
.cstatus { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  color: var(--accent-ink); min-height: 1.2em; margin-top: var(--s-3); }
/* shown only when the clipboard refuses — the brief, selectable by hand */
.cdump {
  width: 100%; margin-top: var(--s-3); min-height: 11rem; resize: vertical;
  font-family: var(--mono); font-size: 0.72rem; line-height: 1.5; color: var(--ink-2);
  padding: var(--s-3); background: var(--paper-hi);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}

/* ── THE PROJECT BOARD · decisions become physical ─────────────────────────*/
.project-board {
  position: sticky; top: clamp(5rem, 12vh, 7.5rem);
  padding: var(--s-4);
  background: var(--paper-lo); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--sh-mount);
  min-height: 16rem;
}
.board-title {
  font-family: var(--mono); font-size: var(--t-label);
  letter-spacing: var(--ls-label); text-transform: uppercase;
  color: var(--graphite); margin-bottom: var(--s-4);
  padding-bottom: var(--s-3); border-bottom: 1px solid var(--line);
}
.board-empty { font-size: var(--t-small); color: var(--graphite-2); font-style: italic; }
.board-mounts { display: grid; gap: var(--s-3); }
/* a mounted piece: pinned, slightly crooked, landing in held frames */
.mount {
  position: relative; padding: 0.7em 0.9em 0.75em;
  background: var(--paper-hi); border: 1px solid var(--line);
  box-shadow: var(--sh-pin); border-radius: 3px;
  transform: rotate(var(--r, 0deg));
  animation: mountPiece 0.3s steps(4, end) both;
}
@keyframes mountPiece {
  from { opacity: 0; transform: translateY(-12px) rotate(var(--r, 0deg)) scale(1.04); }
  to   { opacity: 1; transform: translateY(0) rotate(var(--r, 0deg)) scale(1); }
}
.mount .mk {
  display: block; font-family: var(--mono); font-size: 0.54rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--graphite-2);
  margin-bottom: 0.2em;
}
.mount .mv { font-size: var(--t-small); color: var(--ink); font-weight: 500; }
.mount .mv.multi { font-size: 0.8rem; color: var(--ink-2); font-weight: 400; }
/* the pin itself */
.mount::before {
  content: ""; position: absolute; top: -4px; left: 12px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 1px 2px rgba(28,20,10,0.5);
}
.board-done {
  margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-ink);
}

@media (max-width: 900px) {
  .create-grid { grid-template-columns: 1fr; }
  /* on a phone the board goes ABOVE the flow and stops being sticky — a
     sticky panel would eat the screen the form needs (§37) */
  .project-board { position: static; order: -1; min-height: 0; }
  .board-mounts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) { .board-mounts { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .cstep, .mount { animation: none; }
  .copt .face, .chip .face { transition: none; }
}
