html { color-scheme: light dark; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:root {
  /* Neutrals carry a faint green bias so they belong to the teal, not to a
     default grey. */
  --paper:      #FAFCFB;
  --surface:    #FFFFFF;
  --sunken:     #F2F6F5;
  --ink:        #13201E;
  --ink-soft:   #4C5F5C;
  --ink-faint:  #7A8C89;
  --rule:       #DCE6E3;
  --rule-soft:  #E9F0EE;
  --brand:      #0F766E;
  --brand-soft: #E4F2EF;
  --warn:       #9A5B12;
  --warn-soft:  #FCF1E0;

  --measure: 66ch;
  --step--1: clamp(0.82rem, 0.80rem + 0.10vw, 0.88rem);
  --step-0:  clamp(1.00rem, 0.97rem + 0.16vw, 1.08rem);
  --step-1:  clamp(1.22rem, 1.15rem + 0.35vw, 1.42rem);
  --step-2:  clamp(1.55rem, 1.40rem + 0.72vw, 2.05rem);
  --step-3:  clamp(2.10rem, 1.75rem + 1.70vw, 3.30rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #0D1514;
    --surface:    #15201E;
    --sunken:     #1B2725;
    --ink:        #E7EFED;
    --ink-soft:   #A8BAB6;
    --ink-faint:  #7E918D;
    --rule:       #2A3937;
    --rule-soft:  #223130;
    --brand:      #5ED3C6;
    --brand-soft: #13302D;
    --warn:       #E0A85C;
    --warn-soft:  #2E2415;
  }
}

:root[data-theme="dark"] {
  --paper:      #0D1514;
  --surface:    #15201E;
  --sunken:     #1B2725;
  --ink:        #E7EFED;
  --ink-soft:   #A8BAB6;
  --ink-faint:  #7E918D;
  --rule:       #2A3937;
  --rule-soft:  #223130;
  --brand:      #5ED3C6;
  --brand-soft: #13302D;
  --warn:       #E0A85C;
  --warn-soft:  #2E2415;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.75rem, 1rem + 3vw, 4rem) clamp(1.15rem, 0.6rem + 2.4vw, 2rem) 5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

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

.masthead { display: flex; flex-direction: column; gap: 1rem; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}
.brand svg { display: block; }

h1 {
  margin: 0;
  font-family: Newsreader, Georgia, "Times New Roman", serif;
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.standfirst {
  margin: 0;
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.dates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: var(--step--1);
  color: var(--ink-faint);
}
.dates b { color: var(--ink-soft); font-weight: 500; }

/* --- receipt-styled summary ----------------------------------------- */

/* Struka means "struk". The one place the page borrows the app's own
   material is the block that answers the reader's real question. */
.receipt {
  background: var(--surface);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  padding: 1.6rem clamp(1.1rem, 0.7rem + 1.6vw, 1.9rem) 1.75rem;
  position: relative;
}
.receipt::before,
.receipt::after {
  content: "";
  position: absolute;
  left: -1px; right: -1px;
  height: 7px;
  background-repeat: repeat-x;
  background-size: 14px 7px;
}
.receipt::before {
  top: 0;
  background-image: linear-gradient(135deg, var(--paper) 50%, transparent 50%),
                    linear-gradient(-135deg, var(--paper) 50%, transparent 50%);
  background-position: 0 0, 7px 0;
  background-size: 14px 7px, 14px 7px;
}
.receipt::after {
  bottom: 0;
  background-image: linear-gradient(45deg, var(--paper) 50%, transparent 50%),
                    linear-gradient(-45deg, var(--paper) 50%, transparent 50%);
  background-position: 0 0, 7px 0;
  background-size: 14px 7px, 14px 7px;
}

.receipt h2 {
  margin: 0 0 1.1rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.receipt ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.85rem; }
.receipt li { display: grid; grid-template-columns: 1.35rem 1fr; gap: 0.7rem; align-items: start; }
.receipt li svg { margin-top: 0.32em; color: var(--brand); }
.receipt li b { font-weight: 600; }

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

main { display: flex; flex-direction: column; gap: 2.75rem; }

section { display: flex; flex-direction: column; gap: 0.9rem; scroll-margin-top: 1.5rem; }

section + section { border-top: 1px dashed var(--rule); padding-top: 2.75rem; }

h2.head {
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h3 {
  margin: 1rem 0 0;
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: -0.005em;
}

p { margin: 0; max-width: var(--measure); text-wrap: pretty; }

a { color: var(--brand); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 2px; }

ul.plain { margin: 0; padding-left: 1.15rem; max-width: var(--measure); display: flex; flex-direction: column; gap: 0.55rem; }
ul.plain::marker { color: var(--ink-faint); }

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

nav.toc {
  background: var(--sunken);
  border: 1px solid var(--rule-soft);
  padding: 1.1rem 1.3rem 1.25rem;
}
nav.toc h2 {
  margin: 0 0 0.7rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
nav.toc ol {
  margin: 0; padding: 0; list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.35rem 1.5rem;
  font-size: var(--step--1);
}
nav.toc a { color: var(--ink-soft); text-decoration: none; }
nav.toc a:hover { color: var(--brand); text-decoration: underline; }

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

.scroll { overflow-x: auto; border: 1px solid var(--rule); background: var(--surface); }

table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: var(--step--1); }
caption { text-align: left; padding: 0 0 0.55rem; color: var(--ink-faint); font-size: var(--step--1); }
th, td { text-align: left; padding: 0.72rem 0.95rem; vertical-align: top; border-bottom: 1px solid var(--rule-soft); }
thead th {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--sunken);
  border-bottom: 1px solid var(--rule);
}
tbody tr:last-child td { border-bottom: none; }
td.term { font-weight: 500; white-space: nowrap; }

/* --- callout --------------------------------------------------------- */

.note {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.note.caution { background: var(--warn-soft); border-left-color: var(--warn); }
.note p { max-width: none; }
.note strong { font-weight: 600; }

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

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--rule);
}
.contact div { display: flex; flex-direction: column; gap: 0.15rem; }
.contact dt, .contact .label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

footer {
  color: var(--ink-faint);
  font-size: var(--step--1);
  border-top: 1px dashed var(--rule);
  padding-top: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
