/* laktionov.com — classified dossier variant. Static, no JS, pure CSS art. */

:root {
  --desk: #2c2823;
  --manila: #e6d7ae;
  --manila-edge: #cdbb8c;
  --paper: #f8f3e3;
  --paper-deep: #f1e8d1;
  --ink: #292319;
  --faded: #6d6350;
  --rule: #c9bda0;
  --stamp-red: #ab3226;
  --stamp-blue: #2b4a8a;
  --link: #1f4c9c;
  --redact: #211d16;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  display: flex;
  justify-content: center;
  padding: clamp(16px, 5vw, 64px) 12px;
  background:
    radial-gradient(ellipse at 50% -20%, #3a352e, transparent 70%),
    var(--desk);
  color: var(--ink);
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.62;
}

::selection { background: var(--stamp-red); color: var(--paper); }

/* ---- folder + sheet ---- */

.folder {
  position: relative;
  width: 100%;
  max-width: 872px;
  min-width: 0;
  margin-top: 26px;
  background: linear-gradient(180deg, var(--manila), #dccb9d);
  border: 1px solid var(--manila-edge);
  border-radius: 6px 10px 8px 8px;
  padding: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.tab {
  position: absolute;
  top: -27px;
  left: 26px;
  padding: 3px 20px 8px;
  background: linear-gradient(180deg, #ecdfb9, var(--manila));
  border: 1px solid var(--manila-edge);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: #5d5238;
}

.sheet {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.5), transparent 60%),
    linear-gradient(180deg, var(--paper), var(--paper-deep));
  border: 1px solid #ddd2b6;
  box-shadow: inset 0 0 90px rgba(120, 90, 20, 0.09), 0 1px 0 rgba(255, 255, 255, 0.4);
  padding: 0 0 4px;
}

.sheet > section, .sheet > header, .sheet > footer {
  padding: 0 clamp(18px, 4.5vw, 44px);
}

/* ---- banner + file head ---- */

.banner {
  margin: 0;
  padding: 0.45rem 1rem;
  background: #33623a;
  color: #f2eedb;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
}

.banner:last-child { margin-top: 2.2rem; }

.filehead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 2rem;
  margin-top: 1.9rem;
  padding-bottom: 1.1rem;
  border-bottom: 3px double var(--ink);
}

.doc-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.doc-line { margin: 0.15rem 0 0; color: var(--faded); font-size: 0.82rem; letter-spacing: 0.06em; }

/* ---- stamps ---- */

.stamp {
  display: inline-block;
  padding: 0.4em 0.9em;
  border: 3px solid currentColor;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.82;
  mix-blend-mode: multiply;
  box-shadow: inset 0 0 0 1px var(--paper), inset 0 0 0 2px currentColor;
}

.stamp-red { color: var(--stamp-red); transform: rotate(-7deg); }
.stamp-blue { color: var(--stamp-blue); transform: rotate(4deg); }

.stamp-date {
  display: block;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid currentColor;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
}

/* ---- subject block ---- */

.subject {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.6rem 2.5rem;
  margin-top: 1.7rem;
}

.fields {
  flex: 1 1 24rem;
  min-width: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.4rem;
  margin: 0;
}

.fields dt {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--faded);
  padding-top: 0.12rem;
}

.fields dd { margin: 0; min-width: 0; overflow-wrap: break-word; }

.hint { color: var(--faded); font-size: 0.78rem; }

.photo-frame {
  margin: 0.4rem 1rem 0 0;
  background: #fdfcf7;
  padding: 9px 9px 6px;
  border: 1px solid #d8cfb5;
  box-shadow: 3px 5px 14px rgba(60, 45, 10, 0.3);
  transform: rotate(2.4deg);
  text-align: center;
}

.photo-frame::before {
  content: "";
  position: absolute;
  top: -13px; left: 55%;
  width: 88px; height: 26px;
  margin-left: -44px;
  background: rgba(226, 208, 158, 0.65);
  border: 1px solid rgba(180, 158, 104, 0.35);
  transform: rotate(-8deg); /* frame is +2.4deg, so net ~-5.6deg — visibly hand-placed */
  z-index: 1; /* tape laps over the photo edge, not under it */
}

.photo-frame { position: relative; }

.photo-frame img { display: block; width: 160px; height: 160px; }

.photo-frame figcaption {
  margin-top: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--faded);
}

/* ---- declassify control (pure CSS checkbox hack) ---- */

.declassify {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faded);
  cursor: pointer;
  user-select: none;
}

.declassify:hover { color: var(--ink); }

.dbox {
  width: 0.9em;
  height: 0.9em;
  border: 1.5px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.declassify-input:checked ~ .subject .dbox::before {
  content: "\2715";
  color: var(--stamp-red);
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1;
}

.declassify-input:checked ~ section .redacted {
  background: rgba(33, 29, 22, 0.12);
  color: inherit;
}

.declassify-input:checked ~ section .hint { display: none; }

.declassify-input:focus-visible ~ .subject .declassify {
  outline: 2px solid var(--stamp-red);
  outline-offset: 2px;
}

/* ---- redaction bars ---- */

.redacted {
  background: var(--redact);
  color: transparent;
  padding: 0 0.4em;
  border-radius: 2px;
  cursor: help;
  transition: background 0.4s ease, color 0.4s ease;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.redacted:hover, .redacted:focus-visible {
  background: rgba(33, 29, 22, 0.12);
  color: inherit;
  outline: none;
}

/* ---- sections ---- */

section { margin-top: 2.4rem; }

h2 {
  margin: 0 0 1.05rem;
  font-size: 0.94rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  padding-bottom: 0.35rem;
  border-bottom: 3px double var(--ink);
}

h3 { margin: 0; font-size: 0.98rem; font-weight: 700; }

p { margin: 0 0 1rem; }
p, li, dd { text-wrap: pretty; }
section > p:last-child { margin-bottom: 0; }

.op { margin-bottom: 1.5rem; }
.op:last-of-type { margin-bottom: 1rem; }

.op-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.1rem 1rem;
}

.dates { margin: 0; color: var(--faded); font-size: 0.8rem; white-space: nowrap; }

ul { margin: 0.45rem 0 0; padding: 0; list-style: none; }

li { padding-left: 1.35em; margin: 0.2rem 0; }

li::before { content: "–"; color: var(--faded); margin-left: -1.35em; padding-right: 0.72em; }

.pre-history { color: var(--faded); font-size: 0.88rem; margin: 1.2rem 0 0; }

/* ---- certs ---- */

.certs li {
  display: grid;
  grid-template-columns: 4.8rem 1fr auto;
  gap: 0.2rem 1.1rem;
  padding: 0.45rem 0;
  margin: 0;
  border-bottom: 1px dashed var(--rule);
  align-items: baseline;
}

.certs li:first-child { border-top: 1px dashed var(--rule); }
.certs li::before { content: none; }

.cert-id { font-weight: 700; letter-spacing: 0.05em; }
.cert-meta { color: var(--faded); font-size: 0.78rem; text-align: right; }

.issuer {
  display: inline-block;
  margin-right: 0.6em;
  padding: 0 0.5em;
  border: 1px solid var(--faded);
  border-radius: 2px;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.5; /* explicit height; no vertical-align nudge — Safari grid baseline bug */
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--faded);
}

/* ---- key/value ---- */

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
  margin: 0;
}

.kv dt { font-weight: 700; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: break-word; }

/* ---- links ---- */

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
}

a:hover { text-decoration-color: var(--link); }

a:focus-visible {
  outline: 2px solid var(--stamp-red);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- footer ---- */

footer {
  margin-top: 2.6rem;
  padding-top: 1.2rem;
  border-top: 3px double var(--ink);
  text-align: center;
}

footer p { margin: 0.3rem 0 0; color: var(--faded); font-size: 0.78rem; letter-spacing: 0.06em; }

footer .stamp { margin-bottom: 0.4rem; }

/* ---- accessibility & small screens ---- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .redacted { transition: none; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }

  .folder { padding: 8px; }
  .tab { font-size: 0.7rem; top: -24px; left: 14px; }

  .subject { justify-content: center; }
  .photo-frame { margin-right: 0; }

  .fields { grid-template-columns: max-content 1fr; }

  .certs li { grid-template-columns: 4.8rem 1fr; }
  .cert-meta { grid-column: 2; text-align: left; }

  .kv { grid-template-columns: 1fr; gap: 0.12rem; }
  .kv dd { margin: 0 0 0.55rem 1.5ch; }

  .filehead { flex-direction: column; }
  .stamp-red { align-self: flex-end; margin-top: -0.5rem; }
}

/* ---- print: the page becomes the paper ---- */

@page { margin: 12mm; }

@media print {
  html {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    background: #fff;
  }

  /* solid backgrounds only — Safari repaints gradients per page fragment
     and bleeds the dark desk through (black wedges) */
  body {
    display: block;
    padding: 0;
    background: #fff;
    font-size: 13.5px; /* letter-width paper is narrower than the 872px screen design;
                          this keeps the one-line bullets on one line */
  }

  .folder {
    max-width: none;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .tab, .hint, .handling-dt, .handling-dd { display: none; }

  .sheet {
    border: none;
    box-shadow: none;
    background: var(--paper);
  }

  .subject { flex-wrap: nowrap; } /* keep the photo beside the fields, as on screen */

  .banner, .stamp, .redacted, .photo-frame::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* printed copies stay classified, even if declassified on screen */
  .redacted {
    background: var(--redact) !important;
    color: transparent !important;
  }

  a { color: inherit; text-decoration-color: inherit; }

  .op, .certs li, .photo-frame { break-inside: avoid; }
  h2 { break-after: avoid; }

  .stamp { opacity: 1; }

  /* chain-of-custody line, print only */
  footer::after {
    content: "REPRODUCTION RECORD: COPY 1 OF 1 · PRINTED FROM LAKTIONOV.COM";
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--faded);
  }
}
