/* ==========================================================================
   MLF 1.0 — mlf.evemisslab.com

   Direction: the container. MLF is a file format, so the site is built like
   one — dark field, monospace paths, and colour used as a typed field marker
   rather than as decoration.

   The organising system is MLF's own four independent fingerprints. Every
   accent on this site is one of them, and nothing is tinted that does not
   feed one:

     --fp-structural   matrices, coordinates, roles, regions, dependencies, routes
     --fp-content      values and source formulas
     --fp-semantic     normalized structure plus content meaning
     --fp-presentation styles, layout, human-view metadata

   Dark is the default here, unlike its two siblings at mmr. and mmlc. —
   a binary container reads as a field of records, not as paper.
   ========================================================================== */

:root {
  color-scheme: dark light;

  --ground: #14161a;
  --raised: #1c1f25;
  --sunk:   #0e1013;
  --ink:    #e6e4e0;
  --ink-2:  #adaca7;
  --ink-3:  #94938e;
  --rule:   #363a43;
  --hair:   #24272d;

  --fp-structural:   #5cc6d6;
  --fp-content:      #ee8f61;
  --fp-semantic:     #ab93e8;
  --fp-presentation: #dcc463;

  --fp-structural-wash:   #10262b;
  --fp-content-wash:      #2b1a12;
  --fp-semantic-wash:     #201a2e;
  --fp-presentation-wash: #2a2411;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --prose: "Zilla Slab", Georgia, serif;
  --mono: "Azeret Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --measure: 36rem;
  --shell: 70rem;
  --gap: clamp(2.75rem, 6vw, 4.5rem);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #f2f1ee;
    --raised: #fbfaf8;
    --sunk:   #e5e3de;
    --ink:    #16181c;
    --ink-2:  #4c5057;
    --ink-3:  #565a61;
    --rule:   #c8c5be;
    --hair:   #dedbd4;

    --fp-structural:   #146372;
    --fp-content:      #9c4a22;
    --fp-semantic:     #553da0;
    --fp-presentation: #6f5710;

    --fp-structural-wash:   #d9eaee;
    --fp-content-wash:      #f2e2d9;
    --fp-semantic-wash:     #e5e0f2;
    --fp-presentation-wash: #ece6d2;
  }
}

:root[data-theme="light"] {
  --ground: #f2f1ee;
  --raised: #fbfaf8;
  --sunk:   #e5e3de;
  --ink:    #16181c;
  --ink-2:  #4c5057;
  --ink-3:  #565a61;
  --rule:   #c8c5be;
  --hair:   #dedbd4;

  --fp-structural:   #146372;
  --fp-content:      #9c4a22;
  --fp-semantic:     #553da0;
  --fp-presentation: #6f5710;

  --fp-structural-wash:   #d9eaee;
  --fp-content-wash:      #f2e2d9;
  --fp-semantic-wash:     #e5e0f2;
  --fp-presentation-wash: #ece6d2;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--prose);
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

html[lang="zh-Hant"] body {
  font-family: "Zilla Slab", "Noto Serif TC", Georgia, serif;
  line-height: 1.85;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--fp-structural); }
:focus-visible { outline: 2px solid var(--fp-structural); outline-offset: 3px; }

code, var, samp { font-family: var(--mono); font-size: 0.84em; font-style: normal; }
var { color: var(--ink-2); }
em { font-style: italic; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 0.75rem 1rem; background: var(--ink); color: var(--ground);
  font-family: var(--mono); font-size: 0.75rem;
}
.skip:focus { left: 0; }

/* --- nameplate ---------------------------------------------------------- */

.plate {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.plate-in {
  max-width: var(--shell); margin: 0 auto; padding: 0.6rem 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem;
}

.plate-mark {
  font-family: var(--display); font-weight: 700; font-size: 1rem;
  letter-spacing: -0.01em; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 0.4rem;
}
.plate-ver { font-family: var(--mono); font-size: 0.625rem; font-weight: 400; color: var(--ink-3); }

.plate-nav {
  display: flex; gap: 0.9rem; order: 3; flex: 1 0 100%;
  overflow-x: auto; scrollbar-width: none;
}
.plate-nav::-webkit-scrollbar { display: none; }
@media (min-width: 62rem) { .plate-nav { order: 0; flex: 0 1 auto; margin-left: auto; } }

.plate-link {
  font-family: var(--mono); font-size: 0.6875rem; text-decoration: none;
  color: var(--ink-2); white-space: nowrap;
  padding-bottom: 0.12rem; border-bottom: 1.5px solid transparent;
}
.plate-link:hover { color: var(--ink); }
.plate-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--fp-structural); }

.plate-tools { display: flex; gap: 0.45rem; align-items: center; flex-shrink: 0; margin-left: auto; }
@media (min-width: 62rem) { .plate-tools { margin-left: 0; } }

.plate-btn {
  font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-2);
  background: none; border: 1px solid var(--rule); border-radius: 2px;
  padding: 0.25rem 0.5rem; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.plate-btn:hover { color: var(--ink); border-color: var(--ink-2); }

/* --- shell and masthead -------------------------------------------------- */

.shell { max-width: var(--shell); margin: 0 auto; padding-inline: 1.5rem; }

.mast { padding-block: clamp(2.75rem, 7vw, 4.5rem) 0; }

.mast-eyebrow {
  font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 1.25rem;
}

.mast-display {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.9rem, 5.4vw, 3.7rem);
  line-height: 1.03; letter-spacing: -0.03em; margin: 0;
  max-width: 22ch; text-wrap: balance;
}
html[lang="zh-Hant"] .mast-display {
  font-family: "Noto Sans TC", var(--display); letter-spacing: -0.005em; line-height: 1.18;
}

.mast-stand {
  max-width: var(--measure); margin: 1.5rem 0 0;
  font-size: 1.125rem; line-height: 1.6; color: var(--ink-2);
}
html[lang="zh-Hant"] .mast-stand { line-height: 1.85; }

/* --- inline section index (no side rail on this site) -------------------- */

.index {
  margin: 0 0 var(--gap);
  padding-block: 0.85rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; align-items: baseline;
}

.index-label {
  font-family: var(--mono); font-size: 0.5625rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3);
  margin-right: 0.3rem;
}

.index-link {
  font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-2);
  text-decoration: none; border-bottom: 1.5px solid transparent; padding-bottom: 0.1rem;
}
.index-link:hover { color: var(--ink); }
.index-link.is-here { color: var(--ink); border-bottom-color: var(--fp-structural); }

/* --- the anatomy hero ---------------------------------------------------- */

.anatomy {
  margin-top: clamp(2rem, 5vw, 3.25rem);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem;
}
@media (min-width: 60rem) {
  .anatomy { grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); gap: 1.75rem; }
}

.tree { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); background: var(--sunk); }

.tree-row {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem; align-items: center; text-align: left;
  border: 0; border-left: 3px solid transparent;
  background: none; color: var(--ink-2); cursor: pointer;
  padding: 0.4rem 0.6rem;
  font-family: var(--mono); font-size: 0.6875rem; line-height: 1.4;
}
.tree > li + li .tree-row { border-top: 1px solid var(--hair); }
.tree-row:hover { color: var(--ink); background: var(--raised); }
.tree-row[aria-selected="true"] {
  color: var(--ink); background: var(--raised); border-left-color: var(--fp-structural);
}

.tree-path { overflow-wrap: anywhere; }

.chips { display: flex; gap: 2px; flex-shrink: 0; }
.chip { width: 0.55rem; height: 0.55rem; border-radius: 1px; background: var(--hair); }
.chip[data-fp="structural"]   { background: var(--fp-structural); }
.chip[data-fp="content"]      { background: var(--fp-content); }
.chip[data-fp="semantic"]     { background: var(--fp-semantic); }
.chip[data-fp="presentation"] { background: var(--fp-presentation); }

.anatomy-panel {
  border: 1px solid var(--rule); background: var(--raised);
  padding: 1.1rem 1.2rem 1.25rem; align-self: start;
}

.panel-path {
  font-family: var(--mono); font-size: 0.9375rem; font-weight: 500;
  margin: 0 0 0.85rem; padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--hair); overflow-wrap: anywhere;
}

.panel-what { margin: 0; font-size: 0.9375rem; line-height: 1.6; }

.panel-feeds { margin-top: 1rem; }

.panel-label {
  font-family: var(--mono); font-size: 0.5625rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3);
  display: block; margin-bottom: 0.5rem;
}

.feeds { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }

.feed {
  font-family: var(--mono); font-size: 0.6875rem;
  padding: 0.18rem 0.5rem; border: 1px solid currentColor; border-radius: 2px;
}
.feed[data-fp="structural"]   { color: var(--fp-structural);   background: var(--fp-structural-wash); }
.feed[data-fp="content"]      { color: var(--fp-content);      background: var(--fp-content-wash); }
.feed[data-fp="semantic"]     { color: var(--fp-semantic);     background: var(--fp-semantic-wash); }
.feed[data-fp="presentation"] { color: var(--fp-presentation); background: var(--fp-presentation-wash); }

.feeds-none { margin: 0; font-size: 0.8125rem; color: var(--ink-3); font-family: var(--mono); line-height: 1.5; }

.anatomy-caption {
  margin: 0.85rem 0 0; font-size: 0.8125rem; line-height: 1.6;
  color: var(--ink-2); max-width: 46rem;
}

/* --- flow ---------------------------------------------------------------- */

.body { padding-block: var(--gap) clamp(2.75rem, 6vw, 4.25rem); }

.flow > * + * { margin-top: 1.05rem; }
.flow > .h2 { margin-top: var(--gap); }
.flow > .h2:first-child { margin-top: 0; }

.h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.1875rem, 2.6vw, 1.5rem);
  letter-spacing: -0.02em; line-height: 1.22;
  margin-bottom: 1.15rem; padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 5rem;
}
html[lang="zh-Hant"] .h2 { font-family: "Noto Sans TC", var(--display); letter-spacing: 0; }

.p { margin: 0; max-width: var(--measure); }

.quote {
  margin: 1.5rem 0 0; padding: 0 0 0 1.15rem;
  border-left: 3px solid var(--fp-semantic);
  font-size: 1.0625rem; line-height: 1.6; color: var(--ink);
  max-width: 42rem; font-style: italic;
}

.list { margin: 0; padding: 0; list-style: none; max-width: var(--measure); }
.list > li { position: relative; padding-left: 1.35rem; margin-top: 0.5rem; font-size: 0.9875rem; }
.list > li:first-child { margin-top: 0; }
.list > li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.5rem; height: 0.5rem; border: 1.5px solid var(--ink-3);
}

.list-refuse { max-width: 46rem; }
.list-refuse > li { color: var(--ink-2); }
.list-refuse > li::before {
  border: 0; width: auto; height: auto; top: 0;
  content: "\00d7"; font-family: var(--mono); font-size: 0.9rem;
  color: var(--fp-content);
}

/* --- isnt ---------------------------------------------------------------- */

.isnt-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); max-width: 50rem; }

.isnt {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem 0.8rem; align-items: baseline;
  padding-block: 0.68rem; border-bottom: 1px solid var(--hair);
}
@media (min-width: 46rem) {
  .isnt { grid-template-columns: minmax(0, 1fr) 1.8rem minmax(0, 1fr); }
}

.isnt-a { font-size: 0.9375rem; line-height: 1.5; }
.isnt-op { font-family: var(--mono); font-size: 0.875rem; color: var(--fp-content); text-align: center; user-select: none; }
@media (max-width: 45.99rem) {
  .isnt-op { text-align: left; font-size: 0.75rem; }
  .isnt-op::after { content: " is not"; font-family: var(--prose); color: var(--ink-3); }
  html[lang="zh-Hant"] .isnt-op::after { content: " 不是"; }
}
.isnt-b { font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); }

/* --- register ------------------------------------------------------------ */

.reg-wrap { overflow-x: auto; border: 1px solid var(--rule); }
.reg { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.8125rem; line-height: 1.5; }
.reg th {
  text-align: left; font-weight: 600; font-size: 0.5625rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
  padding: 0.62rem 0.9rem; background: var(--sunk);
  border-bottom: 1px solid var(--rule); white-space: nowrap;
}
.reg td { padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
.reg tbody tr:last-child td { border-bottom: 0; }
.reg b { font-weight: 600; }

.reg-pass td {
  border-top: 2px solid var(--rule);
  background: var(--fp-structural-wash) !important;
  color: var(--fp-structural);
  font-weight: 600;
}

/* --- fingerprint definition list ----------------------------------------- */

.fplist { margin: 0; padding: 0; list-style: none; display: grid; gap: 1px; max-width: 48rem; }

.fprow {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem 1.2rem;
  padding: 0.85rem 1rem; background: var(--raised);
  border-left: 3px solid var(--tone);
}
@media (min-width: 42rem) {
  .fprow { grid-template-columns: 9rem minmax(0, 1fr); align-items: baseline; }
}

.fpname {
  font-family: var(--mono); font-weight: 600; font-size: 0.8125rem;
  color: var(--tone); letter-spacing: 0.02em;
}
.fpdef { margin: 0; font-size: 0.9375rem; line-height: 1.55; }

/* --- layers -------------------------------------------------------------- */

.layers { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); max-width: 46rem; }
.layers > li {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  gap: 0.9rem; align-items: baseline;
  padding-block: 0.62rem; border-bottom: 1px solid var(--hair);
  font-size: 0.9375rem;
}
.layers-l { font-family: var(--mono); font-size: 0.75rem; font-weight: 600; color: var(--ink-3); }
.layers > li[data-stable="true"] .layers-l { color: var(--fp-structural); }
.layers-tag {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fp-structural);
}
.layers-note { margin: 0.9rem 0 0; font-size: 0.8125rem; color: var(--ink-2); max-width: 42rem; }

/* --- stamp --------------------------------------------------------------- */

.stamp {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem;
  border-left: 3px solid var(--rule); padding: 0.78rem 0 0.82rem 0.95rem;
  max-width: 46rem; font-size: 0.9375rem;
}
@media (min-width: 42rem) {
  .stamp { grid-template-columns: 7rem minmax(0, 1fr); gap: 0.9rem; align-items: baseline; }
}
.stamp-mark {
  font-family: var(--mono); font-weight: 600; font-size: 0.5625rem;
  letter-spacing: 0.15em; text-transform: uppercase;
}
.stamp-text { margin: 0; }

.stamp[data-state="verified"]     { border-left-color: var(--fp-structural);   background: var(--fp-structural-wash); }
.stamp[data-state="verified"] .stamp-mark { color: var(--fp-structural); }
.stamp[data-state="structural"]   { border-left-color: var(--fp-structural);   background: var(--fp-structural-wash); }
.stamp[data-state="structural"] .stamp-mark { color: var(--fp-structural); }
.stamp[data-state="content"]      { border-left-color: var(--fp-content);      background: var(--fp-content-wash); }
.stamp[data-state="content"] .stamp-mark { color: var(--fp-content); }
.stamp[data-state="semantic"]     { border-left-color: var(--fp-semantic);     background: var(--fp-semantic-wash); }
.stamp[data-state="semantic"] .stamp-mark { color: var(--fp-semantic); }
.stamp[data-state="presentation"] { border-left-color: var(--fp-presentation); background: var(--fp-presentation-wash); }
.stamp[data-state="presentation"] .stamp-mark { color: var(--fp-presentation); }

/* --- defs and code ------------------------------------------------------- */

.defs { margin: 0; border-top: 1px solid var(--rule); max-width: 48rem; }
.defs-row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.18rem 1.3rem;
  padding-block: 0.68rem; border-bottom: 1px solid var(--hair);
}
@media (min-width: 42rem) { .defs-row { grid-template-columns: 12rem minmax(0, 1fr); } }
.defs-term { font-family: var(--mono); font-weight: 500; font-size: 0.75rem; line-height: 1.5; padding-top: 0.1rem; }
.defs-desc { margin: 0; font-size: 0.9375rem; line-height: 1.55; }

.code { margin-top: 1.3rem; border: 1px solid var(--rule); background: var(--sunk); overflow-x: auto; }
.code-tag {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 0.42rem 0.9rem; border-bottom: 1px solid var(--hair);
  background: var(--raised); position: sticky; left: 0;
}
.code pre { margin: 0; padding: 0.9rem; font-family: var(--mono); font-size: 0.75rem; line-height: 1.7; white-space: pre; }

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

.foot { border-top: 1px solid var(--rule); background: var(--sunk); padding-block: 2.25rem 2.75rem; }
.foot-grid { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .foot-grid { grid-template-columns: minmax(0, 1fr) 15rem; gap: 3rem; } }
.foot-note {
  margin: 0; font-size: 0.8125rem; line-height: 1.6; color: var(--ink-2);
  max-width: 42rem; border-left: 3px solid var(--fp-semantic); padding-left: 1rem;
}
.foot-meta { display: grid; gap: 0.45rem; align-content: start; }
.foot-line { font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-3); }
.foot-line a { color: var(--ink-2); }

.gone { padding-block: clamp(4rem, 13vw, 8rem); }
