/* Katha Kavana — dossier. Generated by build/dossier_style.py. */

:root {
  --paper:   #0B0B0C;
  --raised:  #141312;
  --ink:     #E7E2D8;
  --dim:     #8A8378;
  --faint:   #5B554C;
  --rule:    #2A2724;
  --gold:    #B8935A;
  --clay:    #C1622D;
  --col:     72ch;
  --rail:    13rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* The grain keeps a flat near-black from looking like an unstyled page. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.035;
  background-image: radial-gradient(var(--ink) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

.mono, .rec-no, .field-k, .num, .tag, .sig, th, .price, .fname {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

a { color: var(--ink); text-underline-offset: 3px;
    text-decoration-color: var(--faint); }
a:hover { color: var(--gold); text-decoration-color: var(--gold); }

/* Table captions name each table for a screen reader. They are redundant
   beside a record heading that already says "Hours", so they are removed from
   the visual page but not from the accessibility tree. */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--gold);
              color: var(--paper); padding: 0.6rem 1rem; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* --- shell ------------------------------------------------------------- */

.shell { position: relative; z-index: 1;
         padding: 0 clamp(1.15rem, 4vw, 3rem) 6rem; }
@media (min-width: 1000px) {
  .shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr);
           gap: clamp(2rem, 5vw, 4.5rem); max-width: 92rem; margin: 0 auto; }
}

/* --- masthead ---------------------------------------------------------- */

.mast { grid-column: 1 / -1; border-bottom: 1px solid var(--rule);
        padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(1.75rem, 4vw, 2.5rem); }
.mast-kn { color: var(--gold); font-size: 0.95rem; letter-spacing: 0.28em;
           margin: 0 0 0.9rem; }
.mast h1 { font-family: "IBM Plex Mono", monospace; font-weight: 600;
           font-size: clamp(2rem, 7.5vw, 4.25rem); line-height: 1;
           letter-spacing: -0.03em; margin: 0 0 1.4rem; }
.mast .lede { max-width: 58ch; color: var(--dim); margin: 0 0 2rem; }
.mast .lede strong { color: var(--ink); font-weight: 500; }

/* The strip of headline facts under the title, in the order a reader asks
   for them: what, where, when, how much, how good. */
.strip { display: grid; gap: 1px; background: var(--rule);
         border: 1px solid var(--rule); }
@media (min-width: 640px) { .strip { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .strip { grid-template-columns: repeat(5, 1fr); } }
.cell { background: var(--paper); padding: 0.85rem 1rem; }
.cell .k { font-family: "IBM Plex Mono", monospace; font-size: 0.68rem;
           letter-spacing: 0.16em; color: var(--faint); display: block;
           margin-bottom: 0.35rem; }
.cell .v { font-family: "IBM Plex Mono", monospace; font-size: 1.05rem;
           color: var(--ink); }
.cell .v small { color: var(--dim); font-size: 0.78rem; }

/* --- index rail -------------------------------------------------------- */

/* Below 1000px there is no room for a column of records beside the page, but
   an eleven-record document still needs a way in. The rail becomes a strip
   that scrolls sideways under the masthead rather than disappearing. */
.rail { font-family: "IBM Plex Mono", monospace; font-size: 0.78rem;
        border-bottom: 1px solid var(--rule); padding: 0.85rem 0; }
.rail .rail-h { color: var(--faint); letter-spacing: 0.18em;
                margin: 0 0 0.6rem; }
.rail ol { list-style: none; margin: 0; padding: 0 0 0.15rem;
           display: flex; gap: 1.25rem; overflow-x: auto;
           scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rail ol::-webkit-scrollbar { display: none; }
.rail li { white-space: nowrap; }
.rail a { color: var(--dim); text-decoration: none; }
.rail a[aria-current="true"] { color: var(--gold); }

@media (min-width: 1000px) {
  .rail { position: sticky; top: 0; align-self: start; border-bottom: 0;
          height: 100vh; overflow-y: auto; padding: 3rem 0; }
  .rail ol { display: block; overflow: visible; padding: 0; }
  .rail li { margin-bottom: 0.55rem; }
  .rail a { color: var(--faint); text-decoration: none; display: block;
            border-left: 1px solid var(--rule); padding-left: 0.75rem; }
  .rail a:hover { color: var(--ink); }
  .rail a[aria-current="true"] { color: var(--gold);
                                 border-left-color: var(--gold); }
  .rail .rail-h { color: var(--faint); letter-spacing: 0.18em;
                  margin: 0 0 1.1rem; padding-left: 0.75rem; }
}

/* --- records ----------------------------------------------------------- */

.body { min-width: 0; }
.rec { padding: clamp(2.75rem, 6vw, 4.5rem) 0;
       border-bottom: 1px solid var(--rule); scroll-margin-top: 2rem; }
.rec-head { display: flex; align-items: baseline; gap: 1rem;
            flex-wrap: wrap; margin-bottom: 1.75rem; }
.rec-no { color: var(--gold); font-size: 0.8rem; letter-spacing: 0.14em; }
.rec-head h2 { font-family: "IBM Plex Mono", monospace; font-weight: 600;
               font-size: clamp(1.15rem, 3vw, 1.5rem); letter-spacing: 0.02em;
               margin: 0; }
.rec-line { flex: 1 1 3rem; height: 1px; background: var(--rule);
            transform-origin: left center; }
.rec-count { font-family: "IBM Plex Mono", monospace; font-size: 0.72rem;
             color: var(--faint); letter-spacing: 0.1em; }
.rec > p { max-width: var(--col); color: var(--dim); }
.rec > p.note { font-size: 0.9rem; }

/* --- field lists ------------------------------------------------------- */

.fields { margin: 0; display: grid; gap: 0; max-width: var(--col); }
.fields > div { display: grid; gap: 0.15rem 1.5rem;
                padding: 0.7rem 0; border-top: 1px solid var(--rule); }
@media (min-width: 560px) {
  .fields > div { grid-template-columns: 11rem minmax(0, 1fr); }
}
.field-k { font-size: 0.72rem; letter-spacing: 0.14em; color: var(--faint);
           margin: 0; padding-top: 0.2rem; }
.field-v { margin: 0; }
.field-v .sub { display: block; color: var(--dim); font-size: 0.85rem; }
.void { color: var(--faint); font-style: italic; }

/* --- tables ------------------------------------------------------------ */

.tbl-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; max-width: var(--col);
        font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 1.25rem 0.55rem 0;
         border-bottom: 1px solid var(--rule); vertical-align: top;
         white-space: nowrap; }
th { font-size: 0.7rem; letter-spacing: 0.14em; color: var(--faint);
     font-weight: 400; border-bottom-color: var(--dim); }
td.wrap, th.wrap { white-space: normal; min-width: 18rem; }
.num { text-align: right; padding-right: 1.5rem; }
.headline-row td { color: var(--ink); }
.headline-row .num { color: var(--gold); }
.muted-row td { color: var(--dim); }

/* A mark, not a colour alone: the glyph carries the meaning for anyone who
   cannot see the hue. */
.mk { font-family: "IBM Plex Mono", monospace; }
.mk-yes { color: var(--gold); }
.mk-no { color: var(--faint); }
.mk-clash { color: var(--clay); }

/* --- the card ---------------------------------------------------------- */

.chapter-h { margin: 2.75rem 0 0.35rem; font-family: "IBM Plex Mono", monospace;
             font-size: 1rem; letter-spacing: 0.02em; font-weight: 600; }
.chapter-h:first-of-type { margin-top: 1rem; }
.chapter-b { color: var(--dim); font-size: 0.9rem; margin: 0 0 1.25rem;
             max-width: var(--col); }
.sec-h { font-family: "IBM Plex Mono", monospace; font-size: 0.72rem;
         letter-spacing: 0.2em; color: var(--gold); margin: 1.75rem 0 0.5rem; }
.items { margin: 0; max-width: var(--col); }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto;
        gap: 0 0.75rem; align-items: baseline; padding: 0.45rem 0;
        border-bottom: 1px solid var(--rule); }
.item dt { font-weight: 500; }
.price { margin: 0; color: var(--gold); font-size: 0.95rem; }
.item .desc { grid-column: 1 / -1; margin: 0.15rem 0 0; color: var(--dim);
              font-size: 0.85rem; }

/* --- contact sheet ----------------------------------------------------- */

.sheet { display: grid; gap: 1px; background: var(--rule);
         border: 1px solid var(--rule);
         grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
/* margin: 0 is load-bearing — a <figure> carries a 40px UA side margin, which
   pulls every plate off its grid cell and turns the sheet into a column of
   slivers. */
.plate { background: var(--paper); padding: 0.55rem; display: block;
         margin: 0; }
/* height: auto is load-bearing too — the height="300" attribute maps to a
   presentational height, and aspect-ratio is ignored while both axes are
   fixed. The attributes stay because they reserve the right box before the
   image lands. */
.plate img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3;
             object-fit: cover; background: var(--raised);
             filter: grayscale(1) contrast(1.05); }
.plate:hover img, .plate:focus-visible img { filter: none; }
.fname { display: block; font-size: 0.65rem; color: var(--faint);
         margin-top: 0.4rem; letter-spacing: 0.06em; }
.plate .cred { display: block; font-size: 0.65rem; color: var(--faint);
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- prose blocks (sources, conflicts, omissions) ---------------------- */

.entries { display: grid; gap: 0; max-width: var(--col); }
.entry { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.entry h3 { font-family: "IBM Plex Mono", monospace; font-size: 0.78rem;
            letter-spacing: 0.14em; margin: 0 0 0.4rem; color: var(--ink); }
.entry p { margin: 0; color: var(--dim); font-size: 0.92rem; }
.entry.clash h3 { color: var(--clay); }
.entry.gone h3 { color: var(--faint); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.35rem 0 0;
        padding: 0; list-style: none; }
.tag { font-size: 0.72rem; border: 1px solid var(--rule);
       padding: 0.15rem 0.55rem; color: var(--dim); }

/* --- calls ------------------------------------------------------------- */

.calls { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.call { font-family: "IBM Plex Mono", monospace; font-size: 0.85rem;
        text-decoration: none; border: 1px solid var(--gold);
        color: var(--gold); padding: 0.6rem 1.1rem; }
.call:hover { background: var(--gold); color: var(--paper); }
.call.ghost { border-color: var(--rule); color: var(--dim); }
.call.ghost:hover { background: none; border-color: var(--ink);
                    color: var(--ink); }

/* --- map + foot -------------------------------------------------------- */

.map { border: 1px solid var(--rule); width: 100%; aspect-ratio: 16 / 9;
       margin-top: 1.5rem; filter: grayscale(1) invert(0.92) hue-rotate(180deg);
       max-width: var(--col); }

.foot { grid-column: 1 / -1; padding: 2.5rem 0 0; color: var(--faint);
        font-size: 0.82rem; }
.foot p { max-width: var(--col); margin: 0 0 0.6rem; }

/* --- motion ------------------------------------------------------------
   Only .js gets a hidden start state, and app.js takes the class back off if
   its animation library never arrives. */

.js .rise { opacity: 0; transform: translateY(14px); }
.js .rec-line { transform: scaleX(0); }

@media (prefers-reduced-motion: reduce) {
  .js .rise, .js .rec-line { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
