/* =====================================================================
   Paper and Ink · essays/the-data-you-keep.css
   "The Data You Keep": the figures only this essay uses.
   Loaded after the shared stylesheets; everything shared lives in css/.
   ===================================================================== */

/* Layout: one 64ch reading column on grained paper; two figures break out to 860px:
   an index card for an archive box that the reader can turn over (Figure 1), and four
   copies of one record traced to their disposal on graph paper (Figure 2).
   Gold = possible future use; blue = present stewardship obligation. */

/* ---- footnote markers -------------------------------------------------- */
sup.ref { font-family: var(--sans); font-size: .62em; line-height: 0; margin-left: 1px; }
sup.ref a { text-decoration: none; color: var(--life); padding: 0 1px; }
sup.ref a:hover { text-decoration: underline; }
sup.ref + sup.ref { margin-left: 3px; }
.sources li:target { color: var(--ink); background: var(--life-soft); }

/* ---- Figure 1: the retention card --------------------------------------- */
/* clip sideways overflow so a stamp's starting scale can never widen the page on a phone */
.cardfig {
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 56px; align-items: start;
  overflow-x: clip; overflow-clip-margin: 14px; padding: 8px 4px 0;
}
.cardstage { position: relative; }
/* without the script, or before it runs, both faces sit stacked: the static alternative */
.rcard { display: grid; gap: 22px; }
.face {
  position: relative; box-sizing: border-box; padding: 18px 22px 22px;
  background:
    var(--noise),
    repeating-linear-gradient(transparent 0 25px, var(--grid-major) 25px 26px) 0 50px / 100% calc(100% - 50px) no-repeat,
    var(--slip);
  font-family: var(--mono); font-size: .8rem; line-height: 26px;
}
/* the red-ruled header line of an index card, drawn in graphite so color keeps its meaning */
.face::before { content: ""; position: absolute; left: 0; right: 0; top: 49px; border-top: 1.5px solid var(--graphite); opacity: .55; }
.face.front { transform: rotate(-1.3deg); }
.face.back { transform: rotate(.8deg); }
.fh { margin: 0; height: 32px; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; }
.fh small { float: right; font-size: .68rem; letter-spacing: .1em; opacity: .7; font-weight: 400; }
.face .ln { display: flex; gap: 6px; margin: 0; }
.face .ln span { flex: none; }
.face .ln span:last-child { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.face .ln i { flex: 1; min-width: 10px; border-bottom: 1px dotted currentColor; opacity: .4; transform: translateY(-.45em); }
.face .ln.once { color: var(--slip-once); }
.face .ln.life { color: var(--slip-life); }
.face .ln .blankline { flex: none; width: 7ch; border-bottom: 1.5px solid currentColor; opacity: .5; transform: translateY(-.35em); }
.face .hw { margin: 4px 0 0; color: var(--slip-once); font-size: 1.15rem; line-height: 26px; }
.face .hw.b { color: var(--slip-life); }
.stamp.k1 { color: var(--slip-once); position: absolute; right: 18px; bottom: 18px; transform: rotate(-7deg); animation-delay: .7s; }
.stamp.k2 { color: var(--slip-life); display: table; margin: 12px 0 0 auto; transform: rotate(5deg); animation-delay: 1.4s; }

/* with the script: one card that turns over in place */
.cardstage.turnable .rcard { display: block; perspective: 1400px; }
.cardstage.turnable .flipper { display: grid; transition: transform .8s cubic-bezier(.4, .1, .2, 1); transform-style: preserve-3d; }
.cardstage.turnable .face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cardstage.turnable .face.back { transform: rotateY(180deg) rotate(.8deg); }
.cardstage.turnable.over .flipper { transform: rotateY(180deg); }
.cardstage.turnable .face.back .stamp.k2 { animation: none; }
.cardstage.turnable.over .face.back .stamp.k2 { animation: thump .45s cubic-bezier(.3, 1.6, .5, 1) .55s both; }
.turnbar { margin: 18px 0 0; font-family: var(--sans); font-size: .8rem; }
.cardstage:not(.turnable) .turnbar { display: none; }

.cardnotes { display: grid; gap: 64px; padding-top: 36px; }
.cardnotes .mnote p { color: var(--ink); }
.cardnotes .n1 { animation: fade .7s ease 1s both; }
.cardnotes .n2 { animation: fade .7s ease 2s both; }
.cardnotes .n1 .pen path { animation-delay: 1s; }
.cardnotes .n2 .pen path { animation-delay: 2s; }
.cardnotes b.g { color: var(--once); }
.cardnotes b.b { color: var(--life); }
/* the arrows point left, at the card */
.cardnotes .pen { transform: scaleX(-1); order: -1; }

/* ---- Figure 2: four copies, one disposal decision ----------------------- */
.copies2 { cursor: crosshair; }
.copies2 .bl { stroke: var(--slip-life); }
.copies2 .gd { fill: none; stroke: var(--slip-once); stroke-width: 2.2; stroke-dasharray: 3 7; stroke-linecap: round; }
.copies2 .lab-life { fill: var(--slip-life); }
.copies2 .lab-once { fill: var(--slip-once); }
.copies2 .pen-g { fill: var(--graphite); }
.copies2 .lane { stroke: var(--graphite); stroke-width: 1; stroke-dasharray: 2 6; opacity: .55; }
.copies2 .loop { fill: none; stroke: var(--graphite); stroke-width: 1.5; stroke-linecap: round; }
.copies2 .done { fill: none; stroke: var(--slip-life); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.copies2 .lname { font-family: var(--mono); font-size: 12.5px; fill: var(--slip-ink); }
.copies2 .ev { font-family: var(--mono); font-size: 10.5px; fill: var(--slip-life); }
.copies2 .tk { stroke: var(--slip-ink); stroke-width: 1; opacity: .55; }
.copies2 .tk.major { opacity: .9; stroke-width: 1.3; }
.copies2 .rowlab { font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; fill: var(--graphite); }
.copies2 .cursor { stroke: var(--graphite); stroke-width: 1.2; stroke-dasharray: 5 5; opacity: .7; }
.copies2 .rdot { fill: var(--slip); stroke-width: 2.4; }
.copies2 .rdot.life { stroke: var(--slip-life); }
.copies2 .rdot.once { stroke: var(--slip-once); }
.copies2 .tagbox { fill: var(--slip); stroke: var(--slip-ink); stroke-width: 1; }
.copies2 .tag-life { fill: var(--slip-life); }
.copies2 .tag-once { fill: var(--slip-once); font-weight: 500; }
/* redraws after the breakpoint changes appear at once, without replaying the load sequence */
.copies2 .still .ink path, .copies2 .still .fade { animation: none; }

@media (max-width: 640px) {
  .cardfig { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cardnotes { gap: 12px; padding-top: 0; }
  .cardnotes .pen { display: none; }
}

/* Phone mode: the card takes the full width with its notes underneath; card lines may
   wrap; the copies chart is redrawn narrower and taller by the page script, with lanes
   stacked further apart, and its labels grow. */
@media (max-width: 560px) {
  .face { padding: 16px 16px 20px; font-size: .76rem; }
  .fh small { float: none; display: block; line-height: 1.2; }
  .face::before { top: 64px; }
  .face { background:
    var(--noise),
    repeating-linear-gradient(transparent 0 25px, var(--grid-major) 25px 26px) 0 64px / 100% calc(100% - 64px) no-repeat,
    var(--slip); }
  .fh { height: auto; min-height: 46px; }
  .sheet.copies2 { min-width: 0; user-select: none; }
  .sheet-scroll:has(.copies2) { overflow-x: clip; }
  .copies2 .svgnote { font-size: 17px; }
  .copies2 .svglab { font-size: 18px; }
  .copies2 .lname { font-size: 15px; }
  .copies2 .ev { font-size: 13px; }
  .copies2 .tick { font-size: 15px; }
  .copies2 .tagtext { font-size: 14px; }
  .copies2 .rowlab { font-size: 13px; }
}
