/* TK Software legal pages (legal.tk-software.co.nz): Terms, Privacy, Support.
   Same look as the licence server's public pages (license-server/public/tk.css): charcoal and ivory,
   one teal accent, Geist with Geist Mono labels and an Instrument Serif italic word. */
:root {
  color-scheme: dark;
  --bg: #131416; --deep: #0f1011; --raised: #18191c;
  --ivory: #F3EEE5; --ink-2: #c9c3b8; --ink-3: #9c968c;
  --line: rgba(243, 238, 229, .12); --line2: rgba(243, 238, 229, .22);
  --teal: #22D3C2; --teal-soft: rgba(34, 211, 194, .10);
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: 88px; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ivory); font: 400 17px/1.65 var(--sans); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-wrap: break-word; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
a { color: var(--ivory); text-decoration-color: rgba(34, 211, 194, .7); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--teal); color: #06201d; padding: 10px 16px; border-radius: 8px; z-index: 20; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* label / accent */
.label { font: 500 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); display: inline-flex; align-items: center; gap: 10px; }
.label::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); box-shadow: 0 0 12px var(--teal); flex: none; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--teal); letter-spacing: -.02em; font-size: 1.08em; }
.mono { font-family: var(--mono); }

/* header */
.top { border-bottom: 1px solid var(--line); background: rgba(19, 20, 22, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.brand img { height: 22px; width: auto; display: block; }
.brand .ink { display: none; }
.top nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.top nav a { text-decoration: none; color: var(--ink-2); font-size: 15px; white-space: nowrap; padding: 4px 0; border-bottom: 1px solid transparent; }
.top nav a:hover { color: var(--ivory); }
.top nav a[aria-current="page"] { color: var(--ivory); border-bottom-color: var(--teal); }
@media (max-width: 480px) { .brand img { height: 18px; } .top nav { gap: 14px; } .top nav a { font-size: 14px; } }

/* page head */
main { flex: 1; }
.page-head { padding: clamp(44px, 7vw, 80px) 0 clamp(24px, 4vw, 36px); display: grid; gap: 16px; max-width: 760px; }
.page-head h1 { font: 620 clamp(40px, 6vw, 68px)/1 var(--sans); letter-spacing: -.05em; margin: 0; text-wrap: balance; }
.lede { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.55; color: var(--ink-2); max-width: 62ch; margin: 0; }
.meta { font: 500 12px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0; }

/* two-column: table of contents + document */
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding-bottom: clamp(56px, 8vw, 96px); }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 14px; padding-bottom: 8px; }
.toc h2 { font: 500 11.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--line); color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ivory); border-left-color: var(--teal); }
.toc .sub { margin-top: 10px; }
@media (max-width: 900px) {
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); padding: 16px 18px; }
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; }
}

/* long-form document */
.doc { max-width: 70ch; min-width: 0; }
.doc > section { padding-top: 8px; }
.doc h2 { font: 620 clamp(23px, 2.4vw, 28px)/1.2 var(--sans); letter-spacing: -.03em; margin: 52px 0 14px; text-wrap: balance; }
.doc > section:first-child h2, .doc .short + section h2 { margin-top: 44px; }
.doc h2 .n { font: 500 13px/1 var(--mono); letter-spacing: .08em; color: var(--teal); margin-right: 10px; vertical-align: 3px; }
.doc h3 { font: 600 18px/1.35 var(--sans); letter-spacing: -.01em; margin: 30px 0 8px; }
.doc p, .doc li, .doc dd { color: var(--ink-2); }
.doc p { margin: 0 0 14px; }
.doc strong { color: var(--ivory); font-weight: 600; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 16px; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--teal); }
.doc .anchor { color: var(--ink-3); text-decoration: none; margin-left: 8px; font-weight: 400; opacity: 0; transition: opacity .2s; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc .anchor:focus { opacity: 1; }

/* "The short version" */
.short { border: 1px solid rgba(34, 211, 194, .35); background: linear-gradient(180deg, var(--teal-soft), rgba(34, 211, 194, .03)); border-radius: 20px; padding: clamp(20px, 3vw, 28px); }
.short h2 { margin: 12px 0 10px !important; font-size: clamp(22px, 2.2vw, 26px); }
.short ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.short li { margin: 0; padding-left: 26px; position: relative; color: var(--ivory); }
.short li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); }
.short p.after { margin: 16px 0 0; font-size: 15px; color: var(--ink-3); }

.card { border: 1px solid var(--line); background: var(--raised); border-radius: 16px; padding: 18px 20px; margin: 18px 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.note { font-size: 15px; color: var(--ink-3) !important; }

/* tables */
.tbl { width: 100%; overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
th { font: 500 11.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); background: var(--deep); }
tr:last-child td { border-bottom: 0; }
td strong { color: var(--ivory); }
@media (max-width: 560px) {
  .tbl.stack { border: 0; }
  .tbl.stack table, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack thead { display: none; }
  .tbl.stack tr { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; padding: 6px 0; }
  .tbl.stack td { border: 0; padding: 6px 14px; }
  .tbl.stack td[data-h]::before { content: attr(data-h); display: block; font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
}

/* Q&A lists (support) */
dl.qa { margin: 0 0 12px; }
dl.qa dt { color: var(--ivory); font-weight: 600; margin-top: 20px; }
dl.qa dd { margin: 4px 0 0; }

/* contact */
.contact { display: grid; gap: 6px; border: 1px solid var(--line2); background: var(--raised); border-radius: 20px; padding: clamp(20px, 3vw, 28px); margin: 18px 0; }
.contact .email { font: 600 clamp(19px, 2.4vw, 24px)/1.3 var(--sans); letter-spacing: -.02em; color: var(--ivory); text-decoration-color: var(--teal); word-break: break-all; }
.contact p { margin: 0; }

/* hub page */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-bottom: clamp(56px, 8vw, 96px); }
@media (max-width: 820px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.cards a { display: grid; gap: 10px; align-content: start; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--raised); text-decoration: none; transition: border-color .2s, transform .2s; }
.cards a:hover { border-color: rgba(34, 211, 194, .55); color: inherit; transform: translateY(-2px); }
.cards h2 { font: 620 24px/1.15 var(--sans); letter-spacing: -.03em; margin: 0; color: var(--ivory); }
.cards p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
.cards .go { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-top: 6px; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: auto; }
.foot .wrap { display: flex; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 26px; font: 500 11px/1.7 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.foot a { text-decoration: none; color: var(--ink-3); }
.foot a:hover { color: var(--ivory); }
.foot nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }

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

/* print: light, plain, every link's address shown */
@media print {
  :root { color-scheme: light; --ivory: #111; --ink-2: #222; --ink-3: #555; --line: #ccc; --line2: #bbb; --raised: #fff; --deep: #f3f3f3; --teal: #0b6f66; --teal-soft: #fff; }
  html, body { background: #fff !important; color: #111; }
  body { font-size: 11pt; line-height: 1.5; display: block; }
  .top { position: static; background: #fff; border-bottom: 1px solid #ccc; backdrop-filter: none; }
  .top nav, .toc, .skip, .doc .anchor { display: none !important; }
  .brand .ivory { display: none; } .brand .ink { display: block; }
  .layout { display: block; padding-bottom: 0; }
  .doc { max-width: none; }
  .wrap { max-width: none; padding: 0; }
  .page-head { padding: 18pt 0 10pt; }
  .page-head h1 { font-size: 26pt; }
  .short, .card, .contact { background: #fff; border: 1px solid #999; break-inside: avoid; }
  .short li::before, .label::before { background: #0b6f66; box-shadow: none; }
  .doc h2, .doc h3 { break-after: avoid; }
  .doc h2 { margin-top: 20pt; }
  a { color: #111; text-decoration: underline; }
  .doc a[href^="http"]::after, .doc a[href^="mailto"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; word-break: break-all; }
  .tbl { overflow: visible; }
  .foot { border-top: 1px solid #ccc; } .foot .wrap { padding: 10pt 0 0; }
}
