:root {
  --paper: #f6f1e7;
  --paper-deep: #ece4d5;
  --ink: #0c2b3a;
  --ink-soft: #294956;
  --jade: #167a63;
  --jade-dark: #0e5d4b;
  --amber: #d58a00;
  --coral: #c95740;
  --slate: #60747d;
  --line: #c9d0ca;
  --white: #fffdf8;
  --focus: #005fcc;
  --shadow: 0 18px 55px rgba(12, 43, 58, .12);
  --radius: 1.25rem;
  --max: 76rem;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 20rem;
  background:
    radial-gradient(circle at 8% 5%, rgba(22, 122, 99, .12), transparent 27rem),
    linear-gradient(180deg, #fbf8f1 0, var(--paper) 42rem);
}

a { color: var(--jade-dark); text-underline-offset: .18em; }
a:hover { color: var(--coral); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: .2rem solid var(--focus);
  outline-offset: .2rem;
  border-radius: .25rem;
}

img { display: block; max-width: 100%; height: auto; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: .5rem;
  left: .5rem;
  transform: translateY(-150%);
  padding: .7rem 1rem;
  background: var(--ink);
  color: var(--white);
  border-radius: .5rem;
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgba(12, 43, 58, .16);
  background: rgba(251, 248, 241, .94);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(calc(100% - 2rem), var(--max));
  min-height: 4.75rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -.025em;
  text-decoration: none;
}

.brand-mark {
  width: 2.55rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: .8rem;
  background: var(--ink);
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  font-family: Georgia, serif;
  font-size: 1.05rem;
}

.brand small {
  display: block;
  color: var(--slate);
  font-size: .67rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.primary-nav { display: flex; align-items: center; gap: .2rem; }
.primary-nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: .5rem .8rem;
  border-radius: .7rem;
  color: var(--ink);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { background: var(--paper-deep); color: var(--ink); }
.primary-nav .help-link { background: var(--jade); color: var(--white); }
.primary-nav .help-link:hover, .primary-nav .help-link[aria-current="page"] { background: var(--jade-dark); color: var(--white); }

.menu-toggle {
  min-width: 2.85rem;
  min-height: 2.85rem;
  display: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.breadcrumbs {
  width: min(calc(100% - 2rem), 70rem);
  margin: 1.2rem auto 0;
  color: var(--slate);
  font-size: .83rem;
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .35rem; color: #85949b; }
.breadcrumbs a { color: inherit; }

.page-shell { width: min(calc(100% - 2rem), 70rem); min-width: 0; margin: 0 auto; padding: 2.1rem 0 5rem; }

.article-header {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.5rem);
  border: 1px solid rgba(12, 43, 58, .15);
  border-radius: calc(var(--radius) + .5rem);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}
.article-header::before {
  content: "";
  position: absolute;
  width: 24rem;
  height: 24rem;
  right: -8rem;
  top: -10rem;
  border: 4.5rem solid rgba(22, 122, 99, .35);
  border-radius: 50%;
}
.article-header::after {
  content: "NZD / CHECK / TRACE";
  position: absolute;
  right: 2rem;
  bottom: 1.2rem;
  color: rgba(255,255,255,.34);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .24em;
}

.eyebrow { margin: 0 0 1rem; color: #a9e0d2; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; line-height: 1.15; }
h1 { position: relative; max-width: 15ch; margin: 0; font-size: clamp(2.45rem, 6vw, 5.4rem); text-wrap: balance; }
.lead { position: relative; max-width: 47rem; margin: 1.4rem 0 0; color: #dce8e8; font-size: clamp(1.08rem, 2vw, 1.34rem); line-height: 1.58; }

.hub-grid {
  margin: 1.4rem 0 2.4rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
.hub-card {
  min-height: 10rem;
  padding: 1.2rem;
  border: 1px solid rgba(12, 43, 58, .18);
  border-radius: 1rem;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(12, 43, 58, .07);
  text-decoration: none;
}
.hub-card:hover { transform: translateY(-2px); border-color: var(--jade); color: var(--ink); }
.hub-card .card-index { display: block; margin-bottom: 2.1rem; color: var(--coral); font-size: .72rem; font-weight: 900; letter-spacing: .12em; }
.hub-card strong { display: block; font-family: Georgia, serif; font-size: 1.25rem; line-height: 1.15; }
.hub-card span:last-child { display: block; margin-top: .55rem; color: var(--slate); font-size: .86rem; line-height: 1.45; }

.article-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  margin-top: 2.4rem;
}

.article-body { min-width: 0; font-size: 1.03rem; }
.article-body > * { min-width: 0; max-width: 48rem; }
.article-body > figure, .article-body > .table-scroll { max-width: none; }
.article-body a { overflow-wrap: anywhere; word-break: break-word; }
.article-body h2 { margin: 3.3rem 0 1rem; color: var(--ink); font-size: clamp(1.75rem, 3vw, 2.5rem); }
.article-body h3 { margin: 2rem 0 .65rem; font-size: 1.35rem; }
.article-body p { margin: 0 0 1.15rem; }
.article-body ul, .article-body ol { padding-left: 1.35rem; }
.article-body li { margin: .45rem 0; padding-left: .25rem; }

.quick-answer {
  position: relative;
  max-width: none !important;
  margin: 0 0 2rem;
  padding: 1.4rem 1.5rem 1.4rem 4.5rem;
  border: 1px solid rgba(22, 122, 99, .32);
  border-radius: var(--radius);
  background: #e8f4ef;
  color: #123d34;
}
.quick-answer::before {
  content: "01";
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jade);
  color: white;
  font-size: .72rem;
  font-weight: 900;
}
.quick-answer p { margin: 0; }

.editorial-figure {
  margin: 2rem 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink);
  box-shadow: var(--shadow);
}
.editorial-figure img { width: 100%; }
.editorial-figure figcaption { padding: .8rem 1rem 1rem; color: #d5e0df; font-size: .82rem; }
.game-visual { width: 100%; max-width: 55rem; margin: 2rem auto; }

.table-scroll {
  width: 100%;
  max-width: 100% !important;
  min-width: 0;
  margin: 1.75rem 0 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
}
table { width: 100%; border-collapse: collapse; min-width: 38rem; font-size: .92rem; }
th, td { padding: .9rem 1rem; border-bottom: 1px solid #dfe4df; text-align: left; vertical-align: top; }
th { background: var(--ink); color: var(--white); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f4f6f1; }

.article-body > ul { padding: 1.25rem 1.25rem 1.25rem 2.6rem; border-left: .35rem solid var(--amber); background: #fff8e7; border-radius: .25rem 1rem 1rem .25rem; }
.article-body > ol { counter-reset: steps; padding: 0; list-style: none; }
.article-body > ol li { counter-increment: steps; position: relative; min-height: 3.2rem; margin: 0; padding: .8rem 0 .8rem 3.7rem; border-bottom: 1px solid var(--line); }
.article-body > ol li::before { content: counter(steps, decimal-leading-zero); position: absolute; left: .2rem; top: .75rem; color: var(--jade); font-weight: 900; font-variant-numeric: tabular-nums; }

.toc {
  position: sticky;
  top: 6rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255,253,248,.88);
}
.toc strong { display: block; margin-bottom: .65rem; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li { margin: .45rem 0; }
.toc a { color: var(--ink-soft); font-size: .82rem; line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--coral); text-decoration: underline; }
.checked-note { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--slate); font-size: .76rem; }

.preview-note {
  width: min(calc(100% - 2rem), 70rem);
  margin: 1rem auto 0;
  padding: .75rem 1rem;
  border: 1px solid #e8c66f;
  border-radius: .75rem;
  background: #fff6d8;
  color: #604700;
  font-size: .82rem;
}

.site-footer { background: var(--ink); color: #d8e3e1; }
.footer-inner {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  padding: 3.5rem 0 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-inner h2, .footer-inner h3 { margin-top: 0; color: white; }
.footer-inner h2 { font-size: 1.7rem; }
.footer-inner h3 { font: 800 .75rem/1.2 Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.footer-inner ul { margin: 0; padding: 0; list-style: none; }
.footer-inner li { margin: .4rem 0; }
.footer-inner a { color: #c3dfd8; }
.footer-legal { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15); color: #9fb2b6; font-size: .8rem; }

.error-page { min-height: 55vh; display: grid; align-content: center; }
.error-code { margin: 0; color: var(--coral); font: 900 .75rem/1 Inter, sans-serif; letter-spacing: .16em; }
.error-page h1 { color: var(--ink); }

@media (max-width: 62rem) {
  .menu-toggle { display: grid; }
  .primary-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 1rem;
    left: 1rem;
    display: none;
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: 0 0 1rem 1rem;
    background: var(--white);
    box-shadow: var(--shadow);
  }
  .primary-nav[data-open="true"] { display: grid; }
  .primary-nav a { width: 100%; }
  .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; order: -1; }
  .toc ul { columns: 2; column-gap: 1.5rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-intro { grid-column: 1 / -1; }
}

@media (max-width: 42rem) {
  .header-inner { min-height: 4.25rem; }
  .brand-text { font-size: .92rem; }
  .brand small { display: none; }
  .page-shell { padding-top: 1.25rem; }
  .article-header { padding: 2rem 1.35rem 2.6rem; }
  .article-header::after { right: 1.25rem; }
  .article-header::before { opacity: .5; }
  h1 { font-size: clamp(2.15rem, 12vw, 3.35rem); }
  .lead { font-size: 1.02rem; }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-card { min-height: 8.5rem; }
  .hub-card .card-index { margin-bottom: 1.3rem; }
  .quick-answer { padding: 4.3rem 1.15rem 1.2rem; }
  .quick-answer::before { left: 1.15rem; }
  .toc ul { columns: 1; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-intro, .footer-legal { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .site-header, .toc, .preview-note, .site-footer { display: none; }
  body { background: white; }
  .page-shell { width: 100%; }
  .article-header { color: black; background: white; box-shadow: none; }
  .lead { color: #333; }
}
