/* ISO 27555 Revision Checker
   A controlled document read on screen: ink masthead, paper body, a status spine,
   clause ledger rows and mono data. Deliberately unlike the estate's other checkers. */

:root {
  --ink: #14110f;
  --ink-soft: #332d27;
  --paper: #f7f4ed;
  --sheet: #fffdf8;
  --oxblood: #8c2f1f;
  --oxblood-deep: #6d2418;
  --steel: #1f4e5f;
  --steel-deep: #143743;
  --ochre: #b8862b;
  --rule: #d8d1c2;
  --rule-strong: #b9ae98;
  --muted: #575147;
  --mono: "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --wrap: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--oxblood); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--oxblood-deep); text-decoration-thickness: 2px; }
p { margin: 0 0 1.05em; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); line-height: 1.08; letter-spacing: -0.018em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.05rem); line-height: 1.18; margin: 2.1em 0 .55em; }
h3 { font-size: 1.22rem; line-height: 1.32; margin: 1.6em 0 .4em; }
h4 { font-size: 1.02rem; margin: 1.2em 0 .3em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin: 0 0 .45em; }
code, .mono, .code { font-family: var(--mono); font-size: .88em; letter-spacing: .01em; }
strong { font-weight: 700; }
.small { font-size: .95rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .8rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }
.wrap { width: min(var(--wrap), calc(100% - 2.5rem)); margin: 0 auto; }
.measure { max-width: 68ch; }
.narrow { max-width: 780px; }

/* Masthead */
.masthead { background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--oxblood); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; min-height: 78px; padding: .55rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--paper); line-height: 1.1; }
.brand .redact { display: grid; place-items: center; background: var(--oxblood); color: #fff; font-family: var(--mono); font-size: .82rem; letter-spacing: .06em; padding: .55rem .6rem; min-width: 64px; }
.brand .word { font-family: var(--serif); font-size: 1.16rem; font-weight: 600; }
.brand small { display: block; font-family: var(--mono); font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: #e8e1d2; margin-top: .28rem; }
nav.main { display: flex; flex-wrap: wrap; gap: .15rem; font-family: var(--sans); font-size: .92rem; }
nav.main a { text-decoration: none; color: #f1ebdf; padding: .55rem .6rem; min-height: 40px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
nav.main a:hover, nav.main a[aria-current="page"] { color: #fff; border-bottom-color: var(--ochre); }

/* Status spine */
.spine { border-top: 3px solid var(--ochre); background: var(--sheet); padding: 1.1rem 1.2rem 1.2rem; }
.spine h2 { font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--steel-deep); margin: 0 0 .7rem; }
.spine dl { margin: 0; }
.spine dt { font-family: var(--mono); font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: .75rem; }
.spine dd { margin: .1rem 0 0; font-size: 1rem; line-height: 1.4; color: var(--ink); }
.spine .flag { display: inline-block; background: var(--oxblood); color: #fff; font-family: var(--mono); font-size: .8rem; letter-spacing: .05em; padding: .3rem .5rem; margin-bottom: .2rem; }
.spine .date { font-family: var(--mono); font-size: 1rem; }

/* Hero */
.hero { padding: 2.6rem 0 2.2rem; border-bottom: 2px solid var(--rule-strong); }
.hero-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.6rem; align-items: start; }
.hero-copy h1 { max-width: 20ch; }
.eyebrow { font-family: var(--mono); font-size: .85rem; letter-spacing: .09em; text-transform: uppercase; color: var(--steel-deep); margin: 0 0 .8rem; }
.lede { font-size: 1.16rem; line-height: 1.55; color: var(--ink-soft); max-width: 62ch; }
.hero-photo { margin-top: 1.6rem; border-top: 2px solid var(--ink); padding-top: .55rem; }
.hero-photo img { width: 100%; height: 300px; object-fit: cover; }
.hero-photo figcaption { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-top: .4rem; }

/* Sections and ledgers */
.section { padding: 2.3rem 0; border-bottom: 2px solid var(--rule-strong); }
.section:last-of-type { border-bottom: 0; }
.kicker { font-family: var(--mono); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--steel-deep); margin: 0 0 .5rem; }
.ledger { width: 100%; border-collapse: collapse; margin: 1.2rem 0 1.4rem; }
.ledger caption { text-align: left; font-family: var(--mono); font-size: .82rem; color: var(--muted); padding: 0 0 .5rem; }
.ledger th { text-align: left; font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: #efe9dc; padding: .6rem .65rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-strong); vertical-align: bottom; }
.ledger td { padding: .8rem .65rem; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 1rem; }
.ledger td.code { font-family: var(--mono); font-size: .92rem; white-space: nowrap; color: var(--steel-deep); }
.ledger tr:last-child td { border-bottom: 2px solid var(--ink); }
.ledger .level { font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; color: var(--ink-soft); }
.ledger a { font-weight: 600; }

/* Clause rows on the home page */
.clause-list { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 2px solid var(--ink); }
.clause-list li { display: grid; grid-template-columns: 62px 1fr auto; gap: 1rem; align-items: baseline; margin: 0; padding: .9rem .2rem; border-bottom: 1px solid var(--rule); }
.clause-list li:last-child { border-bottom: 2px solid var(--ink); }
.clause-list .c { font-family: var(--mono); font-size: .92rem; color: var(--steel-deep); }
.clause-list .t { font-family: var(--serif); font-size: 1.1rem; }
.clause-list .t a { text-decoration: none; color: var(--ink); }
.clause-list .t a:hover { color: var(--oxblood); text-decoration: underline; }
.clause-list .lv { font-family: var(--mono); font-size: .8rem; color: var(--muted); text-align: right; }

/* Prices */
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 1.2rem; }
.price { background: var(--sheet); border-top: 4px solid var(--ink); padding: 1.4rem 1.3rem 1.2rem; }
.price.accent { border-top-color: var(--oxblood); }
.price h3 { margin-top: 0; }
.amount { font-family: var(--serif); font-size: 2.1rem; line-height: 1.1; margin: .2rem 0 .1rem; color: var(--ink); }
.amount span { font-family: var(--sans); font-size: 1rem; color: var(--muted); }
.price .terms { font-family: var(--mono); font-size: .82rem; color: var(--muted); }
.price ul { padding-left: 1.15rem; margin: .8rem 0 1rem; }
.price li { font-size: .98rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.1rem; background: var(--oxblood); color: #fff; text-decoration: none; font-weight: 600; border: 0; border-radius: 0; }
.btn:hover { background: var(--oxblood-deep); color: #fff; }
.btn.alt { background: var(--ink); }
.btn.alt:hover { background: #000; }
.btn.line { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.line:hover { background: var(--ink); color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.2rem 0 .4rem; }

/* Grounding */
.grounding { background: var(--ink); color: #f3ecdf; padding: 2rem 0; margin: 0; }
.grounding h2 { color: #fff; margin-top: 0; }
.grounding p { color: #eee6d8; max-width: 70ch; }
.grounding a { color: #f6d79a; }
.badges { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0 .8rem; }
.badge { border: 1px solid #b9ae98; padding: .4rem .6rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .03em; color: #fff; }
.provenance { border-left: 4px solid var(--ochre); background: var(--sheet); padding: .9rem 1rem; margin: 1.4rem 0 0; font-size: .97rem; }
.provenance p { margin: 0; }

/* Answer blocks */
.answer { border-left: 4px solid var(--oxblood); padding: .15rem 0 .15rem 1rem; margin: 1.2rem 0 1.4rem; font-size: 1.12rem; line-height: 1.55; }
.note { background: #efe9dc; border-top: 2px solid var(--steel); padding: .9rem 1rem; margin: 1.2rem 0; font-size: .98rem; }
.note p:last-child { margin-bottom: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.list-tight li { margin-bottom: .3rem; }

/* Unit page */
.unit-head { padding: 1.8rem 0 1.2rem; }
.crumbs { font-family: var(--mono); font-size: .82rem; color: var(--muted); margin: 0 0 .8rem; }
.crumbs a { color: var(--steel-deep); }
.unit-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.6rem; align-items: start; padding-bottom: 2.4rem; }
.unit-body h2 { margin-top: 1.9rem; }
.unit-body h2:first-child { margin-top: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 2.2rem; margin-bottom: .7rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: .1rem; font-family: var(--mono); font-size: .85rem; color: var(--steel-deep); border: 1px solid var(--rule-strong); width: 1.55rem; height: 1.55rem; display: grid; place-items: center; }
.srcs { margin-top: 2rem; border-top: 2px solid var(--ink); padding-top: .8rem; }
.srcs li { font-size: .95rem; }
.gap-list li { color: var(--ink-soft); }

/* Check form */
.check { background: var(--sheet); border-top: 4px solid var(--steel); padding: 1.3rem 1.3rem 1.5rem; margin-top: 1.2rem; }
fieldset { border: 0; border-top: 1px solid var(--rule); padding: 1rem 0 .4rem; margin: 0 0 .4rem; }
fieldset:first-of-type { border-top: 0; }
legend { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; padding: 0 .3rem 0 0; }
.opt { display: flex; align-items: flex-start; gap: .7rem; padding: .5rem .3rem; min-height: 44px; border-bottom: 1px dotted var(--rule); cursor: pointer; }
.opt:last-child { border-bottom: 0; }
.opt input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--oxblood); flex: 0 0 auto; }
.opt span { font-size: 1rem; line-height: 1.45; }
#result { margin-top: 1.4rem; border-top: 3px solid var(--ink); padding-top: 1rem; }
#result:empty { display: none; }
.result-band { font-family: var(--mono); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--steel-deep); }
.result-name { font-family: var(--serif); font-size: 2rem; margin: .2rem 0 .4rem; }
.result-list { margin: 1rem 0 0; padding-left: 1.2rem; }
.progress { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.msg { font-size: 1rem; }
.err { color: #8c2f1f; font-weight: 600; }

/* FAQ */
.faq { border-top: 2px solid var(--ink); margin-top: 1.2rem; }
.faq details { border-bottom: 1px solid var(--rule); padding: .8rem 0; }
.faq summary { font-family: var(--serif); font-size: 1.1rem; cursor: pointer; min-height: 32px; }
.faq summary::marker { color: var(--oxblood); }
.faq p { margin: .7rem 0 .2rem; max-width: 70ch; }

/* Footer */
footer.site { background: var(--ink); color: #eee6d8; padding: 2.2rem 0 1.6rem; margin-top: 0; }
footer.site a { color: #f6d79a; }
footer.site .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
footer.site h2 { font-family: var(--mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #fff; margin: 0 0 .6rem; }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { margin-bottom: .4rem; }
footer.site .fine { border-top: 1px solid #4a4238; margin-top: 1.6rem; padding-top: .9rem; font-size: .9rem; color: #ded4c2; }
footer.site .fine p { margin-bottom: .5rem; }
footer.site .credit { font-family: var(--mono); font-size: .78rem; color: #d8cdb9; }

/* Tables scroll safely on phone */
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 620px; }

@media (max-width: 900px) {
  .hero-grid, .unit-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .spine { order: -1; }
  .prices, .two, .three, footer.site .cols { grid-template-columns: 1fr; }
  h1 { max-width: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 1.6rem); }
  nav.main { width: 100%; gap: 0; }
  nav.main a { padding: .5rem .5rem; font-size: .9rem; }
  .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; width: 100%; }
  .ledger tr { border-top: 2px solid var(--ink); padding: .5rem 0; }
  .ledger td { border: 0; padding: .3rem .1rem; }
  .ledger td::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .clause-list li { grid-template-columns: 52px 1fr; }
  .clause-list .lv { grid-column: 2; text-align: left; }
  .hero-photo img { height: 210px; }
  .amount { font-size: 1.8rem; }
}
