/* PulsarERP — the security page: the drawn request log, the permission table, what reaches the model,
   one company per lane, and the facts grid. Mechanisms only; every name and figure in a drawing is fictional. */

.mock { display: grid; gap: var(--space-4); padding: var(--space-5); }

/* A numbered list of what holds a property in place. */
.holds { list-style: none; padding: 0; margin-block-start: var(--space-6); display: grid; gap: var(--space-4); counter-reset: hold; }
.holds li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); color: var(--ink-2); counter-increment: hold; text-wrap: pretty; }
.holds li::before {
  content: counter(hold); display: grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-block-start: 0;
  border: 1px solid var(--line-strong); border-radius: 50%;
  font-family: var(--font-mono); font-size: var(--fs-small); color: var(--muted);
}

/* ---- 01 · The request log: one read passes, every write stops ---- */

.req-log { gap: var(--space-3); font-size: var(--fs-small); }
.log-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding-block-end: var(--space-3); border-block-end: 1px solid var(--paper-line); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--paper-muted); }
.log-live { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ok); }
.log-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.req-log ol { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.req-log li {
  display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--paper-2);
  font-family: var(--font-mono);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.req-log li:nth-child(2) { transition-delay: 300ms; }
.req-log li:nth-child(3) { transition-delay: 500ms; }
.req-log li:nth-child(4) { transition-delay: 700ms; }
.can-reveal .stage:not(.is-in) .req-log li { opacity: 0; transform: translateY(6px); }
.verb { font-weight: 600; font-size: var(--fs-label); }
.req-log code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-label); color: var(--paper-muted); }
.res { padding: 1px var(--space-2); border-radius: var(--radius-pill); font-family: var(--font-text); font-size: var(--fs-label); font-weight: 500; }
.req-log .is-ok .verb, .req-log .is-ok .res { color: var(--ok); }
.req-log .is-ok .res { background: color-mix(in srgb, var(--ok) 13%, var(--paper)); }
.req-log .is-no { background: repeating-linear-gradient(-45deg, var(--paper-2) 0 6px, color-mix(in srgb, var(--paper-line) 55%, var(--paper-2)) 6px 7px); }
.req-log .is-no .verb, .req-log .is-no .res { color: var(--paper-warn); }
.req-log .is-no code { text-decoration: line-through; }
.req-log .is-no .res { background: color-mix(in srgb, var(--paper-warn) 12%, var(--paper)); }
.log-foot { font-size: var(--fs-label); color: var(--paper-muted); }

/* "Your half": what our code cannot check, said plainly. */
.half {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: start;
  margin-block-start: var(--space-7); padding: var(--space-5) var(--space-6);
  border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 55%, var(--bg));
}
.half > svg { font-size: 1.4rem; color: var(--accent); margin-block-start: 0.15em; }
.half h3 { font-size: var(--fs-body); font-weight: 600; margin-block-end: var(--space-1); }
.half p { color: var(--ink-2); text-wrap: pretty; }

/* ---- 02 · Who sees what, and the record of every change ---- */

.perm-stage { padding-block-end: 8.5rem; }
.perm-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.perm-table th, .perm-table td { padding: var(--space-2) var(--space-3); border-block-end: 1px solid var(--paper-line); text-align: start; }
.perm-table thead th { font-size: var(--fs-label); font-weight: 500; color: var(--paper-muted); }
.perm-table tbody th { font-weight: 500; }
.perm-table tr:last-child > * { border-block-end: 0; }
.perm-table td { font-size: var(--fs-label); white-space: nowrap; }
.perm-table td svg { vertical-align: -0.15em; margin-inline-end: 3px; }
.perm-table .yes { color: var(--ok); }
.perm-table .yes svg { font-size: 1rem; }
.perm-table .no { color: var(--paper-muted); background: repeating-linear-gradient(-45deg, transparent 0 5px, color-mix(in srgb, var(--paper-line) 70%, transparent) 5px 6px); }
.perm-table .part { color: var(--paper-warn); }

.perm-log {
  position: absolute; inset-inline-start: var(--space-5); bottom: -2.25rem;
  width: min(22rem, 85%);
  padding: var(--space-4);
  background: var(--paper); color: var(--paper-ink);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--paper-line), 0 30px 60px -30px rgb(0 0 0 / 0.5);
  font-size: var(--fs-label);
  transition: opacity 700ms var(--ease-out) 700ms, transform 700ms var(--ease-out) 700ms;
}
.can-reveal .stage:not(.is-in) .perm-log { opacity: 0; transform: translateY(14px); }
.perm-log-head { display: flex; align-items: center; gap: var(--space-2); padding-block-end: var(--space-2); margin-block-end: var(--space-2); border-block-end: 1px solid var(--paper-line); font-size: var(--fs-small); font-weight: 600; }
.perm-log-head svg { color: var(--paper-accent); }
.perm-log ol { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.perm-log li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--space-2); color: var(--paper-muted); }
.perm-log li span:last-child { color: var(--paper-ink); }
.perm-log .num { justify-self: start; font-family: var(--font-mono); white-space: nowrap; }

/* ---- 03 · What reaches the model, and what never does (inside the dark panel) ---- */

.sent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.sent-col { padding: var(--space-6); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--bg) 50%, transparent); }
.sent-title { display: flex; align-items: center; gap: var(--space-3); margin-block-end: var(--space-5); font-weight: 600; }
.sent-title svg { font-size: 1.15rem; color: var(--accent); }
.sent-col ul { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.sent-col li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); color: var(--ink-2); text-wrap: pretty; }
.sent-col li::before { content: ""; width: 6px; height: 6px; margin-block-start: 0.65em; border-radius: 50%; background: var(--line-strong); }
.sent-col.is-kept { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
.sent-col.is-kept li::before { background: var(--accent); }

/* ---- 04 · One door, one lane per company ---- */

.lanes-stage { display: grid; justify-items: center; gap: 0; }
.gate {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--paper); color: var(--paper-ink);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 1px var(--paper-line), 0 16px 34px -26px rgb(0 0 0 / 0.4);
}
.gate svg { font-size: 1.2rem; color: var(--paper-accent); }
.gate b { font-weight: 600; }
.gate small { color: var(--paper-muted); font-size: var(--fs-label); }
/* The branches: a line down from the door, across, and down into each lane. */
.branches { position: relative; width: 66.6%; height: 2.75rem; }
.branches::before { content: ""; position: absolute; inset-inline-start: 50%; top: 0; height: 100%; border-inline-start: 1px dashed var(--line-strong); }
.branches::after { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 50%; border: 1px dashed var(--line-strong); border-block-end: 0; border-radius: 8px 8px 0 0; }
.lanes { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.lane {
  display: grid; gap: var(--space-3); align-content: start;
  padding: var(--space-4);
  background: var(--paper); color: var(--paper-ink);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--paper-line), 0 16px 34px -26px rgb(0 0 0 / 0.4);
  font-size: var(--fs-label);
}
.lane-name { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-small); font-weight: 600; }
.lane-name svg { color: var(--paper-accent); }
.lane ul { list-style: none; padding: 0; display: grid; gap: var(--space-2); color: var(--paper-muted); }
.lane li { display: flex; align-items: center; gap: var(--space-2); padding-block-start: var(--space-2); border-block-start: 1px dashed var(--paper-line); }
.lanes .lane:nth-child(2) { transition-delay: 90ms; }
.lanes .lane:nth-child(3) { transition-delay: 180ms; }

/* ---- 05 · Facts: encryption, sign-in, records ---- */

.fact-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block-start: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.fact-grid li { display: grid; align-content: start; gap: var(--space-3); padding: var(--space-6) var(--space-5); border-block-end: 1px solid var(--line); border-inline-end: 1px solid var(--line); }
.fact-grid .fact-icon { margin-block-end: var(--space-2); }
.fact-grid h3 { font-size: var(--fs-lead); font-weight: 600; line-height: var(--lh-snug); }
.fact-grid p { line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.fact-grid li:nth-child(4n+2) { transition-delay: 70ms; }
.fact-grid li:nth-child(4n+3) { transition-delay: 140ms; }
.fact-grid li:nth-child(4n+4) { transition-delay: 210ms; }

/* ---- 06 · What we need from you ---- */

.needs { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); counter-reset: need; }
.needs li { position: relative; padding: var(--space-6); padding-block-start: var(--space-8); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); counter-increment: need; }
.needs li::before { content: "0" counter(need); position: absolute; top: var(--space-5); inset-inline-start: var(--space-6); font-family: var(--font-mono); font-size: var(--fs-body); color: var(--accent); }
.needs h3 { font-family: var(--font-display); font-size: var(--fs-answer); font-weight: 500; line-height: var(--lh-snug); margin-block-end: var(--space-3); text-wrap: balance; }
.needs p { color: var(--ink-2); line-height: 1.6; text-wrap: pretty; }
.needs li:nth-child(2) { transition-delay: 90ms; }
.needs li:nth-child(3) { transition-delay: 180ms; }

/* ---- Narrow screens ---- */

@media (max-width: 64rem) {
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .needs { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .mock { padding: var(--space-4); }
  .req-log li { grid-template-columns: 3.5rem minmax(0, 1fr) auto; gap: var(--space-2); }
  .half { grid-template-columns: 1fr; padding: var(--space-5); }
  .perm-stage { padding-block-end: var(--space-5); }
  .perm-log { position: relative; inset: auto; width: auto; margin: var(--space-4) var(--space-3) 0; }
  .perm-table th, .perm-table td { padding-inline: var(--space-2); }
  .sent { grid-template-columns: 1fr; }
  .sent-col { padding: var(--space-5); }
  .branches { display: none; }
  .lanes { grid-template-columns: 1fr; margin-block-start: var(--space-4); }
  .fact-grid { grid-template-columns: 1fr; }
}
