/* ═══ secrets.css — THE SAFE: your secrets as osobaya papka folders ═══
   Same contract as Capitol: .secrets > .tube[data-state][data-owned][style="--lv:.42"] > .tube-name + .tube-glass(.tube-level,.tube-mark,.tube-crack) + .tube-read
   --lv = exposure/120 (0..1).   data-state: "ok" | "crack" (≥85; "danger" is accepted as an alias) | "leaked".
   The red cardboard folder with a string tie and the star seal (the "special folder" kept in the General Secretary's safe):
     --lv      → the folder tilts open on its corner; the pages (.tube-level) rise past the cover edge
     crack     → the tie strains, the seal star splits
     leaked    → the folder lies open, photocopies scatter, one photographed page slides out of frame (once)
   Gauge label (app-written): THE SAFE.  Motion: transform/opacity only; reduced motion = static poses. */

.secrets { --danger: .7083; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; padding: 40px 12px 12px; border-radius: 4px; position: relative;
  background: radial-gradient(110% 80% at 50% 0%, color-mix(in srgb, var(--accent, #b0121f) 24%, transparent), transparent 62%), repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 5px), #0b0709;
  border: 1px solid color-mix(in srgb, var(--gold, #d4a93c) 30%, transparent); box-shadow: inset 0 0 0 3px #0b0709, inset 0 0 0 4px color-mix(in srgb, var(--gold, #d4a93c) 18%, transparent); }
.tube { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; }
.tube-name { font: 700 9.5px/1.25 var(--sans, -apple-system, sans-serif); letter-spacing: .16em; text-transform: uppercase; color: var(--paper, #e9dfc4); text-align: center; min-height: 2.5em; display: flex; align-items: flex-end; max-width: 100%; }
.tube[data-state="crack"] .tube-name, .tube[data-state="danger"] .tube-name { color: #ff8a8e; }
.tube[data-state="leaked"] .tube-name { color: #7a7469; text-decoration: line-through; text-decoration-color: #d9262d; text-decoration-thickness: 2px; }
.tube[data-owned="true"] .tube-name::after { content: " · OWNED"; display: inline-block; color: var(--gold, #d4a93c); letter-spacing: .12em; white-space: nowrap; }
.tube[data-state="leaked"] .tube-name::after { content: none; }

/* the folder */
.tube-glass { position: relative; width: 54px; height: 128px; margin-top: 4px; transform-origin: 0 100%; transform: rotate(calc(var(--lv, 0) * -7deg)); transition: transform .9s cubic-bezier(.3, .6, .2, 1); }
.tube-glass::before { content: ""; position: absolute; inset: 14px 0 0; z-index: 3; border-radius: 2px 6px 2px 2px; transform-origin: 0 100%;
  background: linear-gradient(100deg, rgba(255,255,255,.1), transparent 18%, transparent 80%, rgba(0,0,0,.25)), repeating-linear-gradient(90deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px), #a8141d;
  box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.28), 0 8px 14px -8px #000; }
.tube-glass::after { content: ""; position: absolute; left: 6px; top: 0; z-index: 4; width: 20px; height: 15px; border-radius: 3px 3px 0 0; background: #8b0f18; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); } /* the tab */
/* the pages (exposure): a stack of cream sheets rising from the folder; --lv lifts them past the cover edge */
.tube-level { position: absolute; left: 6px; right: 6px; top: 26px; height: 92px; z-index: 2; border-radius: 2px; transform: translateY(calc(var(--lv, 0) * -34px)); transition: transform .9s cubic-bezier(.3, .6, .2, 1);
  background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(60,50,30,.28) 5px 5.7px), #efe6cf; box-shadow: 1.5px 1px 0 -.5px #cfc4a6, 3px 2px 0 -1px #bfb393; }
/* the string tie: a cream cord looped round two cardboard buttons, drawn on the cover */
.tube-mark { position: absolute; left: 4px; right: 4px; top: 70px; height: 0; z-index: 5; transform-origin: 50% 50%; }
.tube-mark::before { content: ""; position: absolute; left: 4px; right: 4px; top: 0; border-top: 1.6px solid #f0e4c2; filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); }
.tube-mark::after { content: ""; position: absolute; left: -1px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: #d8c9a0; box-shadow: 41px 0 0 #d8c9a0, inset 0 0 0 1.5px rgba(0,0,0,.25); }
/* the seal: a wax-red star with a gold rim */
.tube-read { font: 700 12px/1 var(--serif, Georgia, serif); color: color-mix(in srgb, var(--paper, #e9dfc4) 65%, transparent); font-variant-numeric: tabular-nums; }
.tube[data-state="crack"] .tube-read, .tube[data-state="danger"] .tube-read { color: #ff8a8e; }
.tube-crack { position: absolute; left: 50%; top: 40px; z-index: 6; width: 24px; height: 24px; margin-left: -12px; opacity: 1; pointer-events: none;
  background: radial-gradient(circle, var(--gold, #d4a93c) 0 38%, #7a1018 42%); clip-path: polygon(50% 0, 62% 34%, 98% 36%, 70% 58%, 80% 94%, 50% 72%, 20% 94%, 30% 58%, 2% 36%, 38% 34%); filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.tube-crack::after { content: ""; position: absolute; left: 11px; top: -1px; width: 2px; height: 26px; background: #14070a; clip-path: polygon(40% 0, 100% 22%, 20% 48%, 100% 76%, 50% 100%, 0 76%, 70% 48%, 0 22%); opacity: 0; transition: opacity .6s; }

/* ≥85: the tie strains, the seal splits */
.tube[data-state="crack"] .tube-crack::after, .tube[data-state="danger"] .tube-crack::after { opacity: 1; }
.tube[data-state="crack"] .tube-mark, .tube[data-state="danger"] .tube-mark { animation: sc-strain 1.9s ease-in-out infinite; }
.tube[data-state="crack"] .tube-mark::before, .tube[data-state="danger"] .tube-mark::before { border-top-color: #ff9a8e; }
.tube[data-state="crack"] .tube-crack, .tube[data-state="danger"] .tube-crack { animation: sc-seal 1.9s ease-in-out infinite; }
@keyframes sc-strain { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.06) rotate(-1.4deg); } }
@keyframes sc-seal { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12) rotate(5deg); } }

/* leaked: the folder lies open, photocopies scattered, one photographed page slides out of frame */
.tube[data-state="leaked"] .tube-glass { transform: rotate(-4deg); }
.tube[data-state="leaked"] .tube-glass::before { transform: perspective(240px) rotateY(-62deg) scaleX(.9); opacity: .92; }
.tube[data-state="leaked"] .tube-level { top: 30px; transform: rotate(7deg) translate(6px, 8px); box-shadow: -12px 8px 0 -1px #e4dbc2, 9px 14px 0 -1px #d7cdb2, -4px 20px 0 -2px #efe6cf; }
.tube[data-state="leaked"] .tube-mark, .tube[data-state="leaked"] .tube-crack { opacity: 0; animation: none; }
.tube[data-state="leaked"] .tube-glass .tube-level::after { content: ""; position: absolute; inset: 4px -2px 24px 6px; background: #efe6cf; border: 1px solid #bfb393; animation: sc-slide 2.2s cubic-bezier(.4, 0, .2, 1) .2s both; }
@keyframes sc-slide { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(64px, -30px) rotate(14deg); opacity: 0; } }
.tube[data-state="leaked"] .tube-read::after { content: "LEAKED"; color: #ff5a5f; letter-spacing: .14em; font: 800 9px var(--sans, sans-serif); }
.tube[data-state="leaked"] .tube-read { font-size: 0; }

@media (prefers-reduced-motion: reduce) { .tube-glass, .tube-level { transition: none; } .tube-mark, .tube-crack, .tube-level::after { animation: none !important; } .tube[data-state="leaked"] .tube-level::after { opacity: 0; } }
