/* ============================================================
   Privacy — "The Controlled Document".

   The policy printed as a controlled engineering document: a control
   block naming the revision and the commit it was written against, a
   register of numbered, addressable clauses each carrying its own
   reference in the margin, and the document's own revision record.

   Loads on top of sheet_core.css and owns only what is this surface's.
   The head bar is the world's .dhead device and is not redeclared here.
   ============================================================ */

/* ---------- Head ---------- */
.reg-head{ padding-top:clamp(38px,5vw,72px) }
/* The sub-clause steps down rather than matching the statement line for line:
   at display size a longer second line reads louder than the sentence it hangs
   off. Set as a fraction of the H1 so it tracks the same clamp to phone widths
   — the same setting the sign-in slip uses. */
.reg-head h1 .thin{ margin-top:12px; font-size:.46em; letter-spacing:-0.01em }

/* The control block and the contents are peers: what this document is, and
   what is in it. The contents sink, because the document itself leads. */
.ctrl{
  display:grid; gap:var(--gap);
  grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);
  align-items:start;
  margin-top:clamp(26px,3.4vw,44px);
}
.ctrl-body{ padding:clamp(16px,1.9vw,22px) 20px clamp(18px,2.2vw,24px) }
.ctrl .spec{ font-size:13px }
.ctrl .spec dt{ letter-spacing:.1em }

/* ---------- Contents ---------- */
.toc{ list-style:none; margin:0; padding:0 }
.toc a{
  display:flex; align-items:baseline; gap:12px;
  padding:7px 0; text-decoration:none; color:var(--ink);
  font:500 13px/1.5 var(--mono);
  transition:color .18s var(--ease);
}
/* The part number is the referent the register is keyed to, so it is set as
   data the machine printed rather than as a bullet. */
.toc .pn{
  flex:0 0 auto; min-width:16px;
  font:700 11px/1.5 var(--mono); letter-spacing:.16em; color:var(--ink-2);
  transition:color .18s var(--ease);
}
.toc .nm{ flex:0 0 auto }
.toc .dots{ flex:1; border-bottom:1px dotted var(--mountain); transform:translateY(-4px) }
.toc .rg{
  flex:0 0 auto; font:700 12.5px/1.5 var(--mono); color:var(--valley-ink);
  white-space:nowrap;
}
.toc a:hover{ color:var(--valley-ink) }
.toc a:hover .pn{ color:var(--valley-ink) }

/* ---------- The register ---------- */
.register .panel + .panel{ margin-top:var(--gap) }
.part{ scroll-margin-top:96px }

/* A clause is its number, its sentence, and the reference standing behind it.
   The reference is a margin note — a printed key over its value — not a third
   column of argument: this document states facts and cites where each one
   lives. */
.cl{
  display:grid; align-items:start;
  grid-template-columns:58px minmax(0,1fr) minmax(0,232px);
  gap:0 clamp(20px,2.4vw,40px);
  padding:16px 20px 18px;
  scroll-margin-top:96px;
}
.cl + .cl{ border-top:1px solid var(--mountain) }

/* The clause number is the document's addressing system: every clause is
   linkable, and the contents cite these. */
.cl .no{
  font:700 12px/1.75 var(--mono); letter-spacing:.1em; color:var(--ink-2);
}
.cl .txt{
  margin:0; max-width:62ch;
  font-size:15px; line-height:1.6; color:var(--ink);
}

.cl .mar{ margin:0; display:flex; flex-direction:column; gap:5px; padding-top:1px }
.cl .mk{
  font:700 10px/1.4 var(--mono); letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink-2);
}
/* A value the system knows takes the world's data blue. */
.cl .mv{
  font:700 12.5px/1.5 var(--mono); color:var(--valley-ink);
  overflow-wrap:anywhere;
}
/* Nothing stands behind this one, so it is not dressed as a value the system
   knows. This is the mark that makes the margin worth scanning. */
.cl .mv.none{ color:var(--ink-2); font-weight:500 }
.cl .mv a{ color:var(--valley-ink) }

/* Arriving from the contents, the landing part is marked in the world's focus
   colour rather than by a wash it has not earned. */
.part:target > .face,
.cl:target{ outline:2px solid var(--valley-ink); outline-offset:-2px }

/* ---------- Revision record ---------- */
.revs .panel{ margin-top:clamp(20px,2.6vw,30px) }
.rev{ position:relative; padding:clamp(16px,2vw,22px) 20px clamp(18px,2.2vw,24px) }
.rev + .rev{ border-top:1px solid var(--mountain) }

/* The revision in force is the one with a record behind it: the world's
   foil wash under the stamped-row notch. The one it replaced stays on bare
   sheet — the blank is the honest object and reads as one. */
.rev--on{ background:var(--foil-wash) }
.rev--on::after{
  content:""; position:absolute; top:0; right:0; width:26px; height:26px;
  background:var(--foil); clip-path:polygon(100% 0,100% 100%,0 0);
  transform-origin:100% 0;
}

.rev-line{ display:flex; align-items:baseline; gap:12px }
.rev .rn{
  font:italic 700 26px/1 var(--display); letter-spacing:.02em; color:var(--ink);
  flex:0 0 auto;
}
.rev .rs{
  font:700 10.5px/1 var(--mono); letter-spacing:.2em; text-transform:uppercase;
  color:var(--ink-2); flex:0 0 auto;
}
.rev--on .rs{ color:var(--ink) }
.rev .dots{ flex:1; border-bottom:1px dotted var(--mountain); transform:translateY(-4px) }
.rev .rd{
  font:700 12.5px/1 var(--mono); color:var(--valley-ink); flex:0 0 auto; white-space:nowrap;
}
/* The superseded revision's date is still a date the system knows; only its
   standing changed, so it keeps the data colour and loses the stamp. */

/* A revision entry and the schedule of what it withdrew are two halves of one
   record, so they sit beside each other rather than leaving the panel half
   empty under a narrow column of prose. */
.rev-body{
  display:grid; align-items:start;
  grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);
  gap:clamp(18px,2.6vw,44px);
  margin-top:16px;
}
.rev-note{
  margin:14px 0 0; max-width:52ch;
  font-size:12.5px; line-height:1.7; color:var(--ink-2);
}
.rev-body .rev-note{ margin:0 }

/* What the revision withdrew, printed as a list of struck claims. The rule is
   a mountain hairline down the left of an already-bounded panel — a crease,
   not a boundary. */
.withdrew{
  list-style:none; margin:0; padding:0 0 0 18px;
  border-left:1px solid var(--mountain);
}
.withdrew li{
  font-size:12.5px; line-height:1.7; color:var(--ink);
  padding:5px 0;
}
.withdrew li + li{ border-top:1px dotted var(--mountain) }

/* ---------- The surface's one authored moment ----------
   The stamp seats on the revision that is in force. It fires when the record
   actually reaches the reader — it sits below the fold, and a moment nobody is
   present for is not a moment. The notch is painted at rest, so nothing here
   gates content: without JavaScript the stamp is simply already down. */
.revs.is-armed .rev--on::after{ transform:scale(0) }
.revs.is-armed.is-seated .rev--on::after{
  animation:seat-stamp 520ms var(--ease) forwards;
}
@keyframes seat-stamp{
  from{ transform:scale(0) }
  to{ transform:scale(1) }
}
@media (prefers-reduced-motion:reduce){
  /* The marked sheet whole, rather than a 0.001ms flicker of the global reduction. */
  .revs .rev--on::after{ transform:scale(1) !important; animation:none !important }
}

/* ---------- Adaptation ---------- */

/* Two panels stop reading as peers before the register does, and the control
   block leads when they stack: what the document is, then what is in it. */
@media (max-width:900px){
  .ctrl{ grid-template-columns:minmax(0,1fr) }
}

/* The margin note stops being a margin once the clause has no room beside it:
   it drops under the sentence it references, inline, keeping its key and value
   on one line. */
@media (max-width:820px){
  /* The entry and its schedule stop being halves of one line once neither has
     room to be read as one. */
  .rev-body{ grid-template-columns:minmax(0,1fr); gap:16px }

  .cl{
    grid-template-columns:58px minmax(0,1fr);
    gap:0 clamp(16px,2vw,28px);
  }
  .cl .txt{ max-width:none }
  .cl .mar{
    grid-column:2; flex-direction:row; align-items:baseline; gap:10px;
    margin-top:11px; padding-top:9px; border-top:1px dotted var(--mountain);
  }
  .cl .mk{ flex:0 0 auto; line-height:1.5 }
}

@media (max-width:560px){
  /* Same width the core relaxes its spec values at: a leader that can no longer
     reach its value is dropped rather than left pointing at empty sheet, and the
     pair restacks name over figure. */
  .toc a{ flex-wrap:wrap; gap:0 10px; padding:10px 0 }
  .toc .dots{ display:none }
  .toc .nm{ flex:1 }
  .toc .rg{ margin-left:auto }

  .cl{ grid-template-columns:minmax(0,1fr); padding-inline:15px; gap:0 }
  .cl .no{ margin-bottom:7px }
  .cl .mar{ grid-column:1 }
  .ctrl-body,
  .rev,
  .dhead{ padding-inline:15px }
  .rev .rn{ font-size:22px }
}
