/* ==========================================================================
   Tonic Agency | Security & Trust Centre
   Brand elements sourced from tonic-agency.com (Bison / Geomanist, #6c00f0)
   ========================================================================== */

@font-face {
  font-family: Geomanist;
  src: url(assets/fonts/Geomanist-Regular.otf);
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Geomanist;
  src: url(assets/fonts/Geomanist-Bold.otf);
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Bison;
  src: url(assets/fonts/Bison-Bold.ttf);
  font-display: swap;
}

:root {
  --purple: #6c00f0;
  --purple-dark: #5200b8;
  --ink: #1d1d1d;
  --ink-soft: #363636;
  --grey: #6d7472;
  --rule: #e6e4ea;
  --paper: #ffffff;
  --wash: #f7f6f9;
  --yellow: #ffe516;
  --pink: #ff0b4d;

  --sidebar-w: 300px;
  --measure: 46rem;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Geomanist, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--paper);
}

/* --------------------------------------------------------- skip link */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--purple);
  color: #fff;
  padding: .75rem 1.25rem;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------- layout */

.layout {
  display: flex;
  align-items: flex-start;
}

/* --------------------------------------------------------- sidebar */

.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  padding: 2.25rem 1.5rem 0 2.5rem;
  background: var(--wash);
  border-right: 1px solid var(--rule);

  /* Head stays put; only the list beneath it scrolls. */
  display: flex;
  flex-direction: column;
}

.sidebar__head { flex: 0 0 auto; }

.sidebar__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 3rem;
}

.sidebar__logo { display: block; margin-bottom: 1.75rem; }
.sidebar__logo img { width: 132px; height: auto; display: block; }

.sidebar__title {
  font-family: Bison, Impact, sans-serif;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: .02em;
  color: var(--ink);
  margin: 0 0 .35rem;
}
.sidebar__meta {
  font-size: .75rem;
  line-height: 1.5;
  color: var(--grey);
  margin: 0 0 1.75rem;
}

/* --------------------------------------------------------- search */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Frosted panel shared by the search pill and its results. */
:root {
  --glass: rgba(22, 22, 26, .82);
  --glass-edge: rgba(255, 255, 255, .13);
  --blur: blur(20px) saturate(180%);
  --on-dark: #f6f5f8;
  --on-dark-soft: rgba(246, 245, 248, .60);
}

.finder {
  position: fixed;
  z-index: 30;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  padding: 0 3rem 1.75rem;
  /* Only the palette itself catches clicks; the gutter stays inert. */
  pointer-events: none;
}

/* Centred over the reading column. */
.finder__inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 0 auto;
  pointer-events: auto;
}

.finder__scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(29, 29, 29, .26);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.finder.is-open .finder__scrim { opacity: 1; pointer-events: auto; }

/* --------------------------------------------------------- the pill
   Deliberately dark against a light page: the palette should read as a
   separate surface hovering over the document, not part of it. */

.search {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 10px 34px rgba(20, 20, 24, .28), 0 2px 6px rgba(20, 20, 24, .16);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus-within,
.finder.is-open .search {
  border-color: rgba(139, 61, 255, .75);
  box-shadow: 0 12px 38px rgba(108, 0, 240, .34), 0 0 0 3px rgba(108, 0, 240, .22);
}

.search__icon {
  flex: 0 0 auto;
  width: 1.05rem; height: 1.05rem;
  margin: 0 .6rem 0 1.15rem;
  color: var(--on-dark-soft);
  transition: color .15s ease;
}
.finder.is-open .search__icon { color: #a870ff; }

.search__input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: inherit;
  font-size: .9375rem;
  line-height: 1.4;
  color: var(--on-dark);
  background: none;
  border: 0;
  padding: .9rem .5rem .9rem 0;
  -webkit-appearance: none;
  appearance: none;
  caret-color: #a870ff;
}
.search__input::placeholder { color: var(--on-dark-soft); }
.search__input:focus { outline: 0; }
/* The native clear affordance duplicates our own button. */
.search__input::-webkit-search-cancel-button { display: none; }

.search__kbd {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: .7rem;
  line-height: 1;
  color: #fff;
  background: var(--purple);
  border-radius: 999px;
  padding: .28rem .55rem;
  margin-right: 1rem;
}
.finder.is-open .search__kbd { display: none; }

.search__clear {
  flex: 0 0 auto;
  width: 1.75rem; height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: .55rem;
  font-size: 1.15rem;
  line-height: 1;
  color: #fff;
  background: var(--purple);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease;
}
.search__clear:hover { background: #8b3dff; }
/* A class-level display would otherwise outrank the UA's [hidden] rule. */
.search__clear[hidden] { display: none; }

/* ------------------------------------------------------- the palette */

.palette {
  margin-bottom: .6rem;
  border-radius: 1.5rem;
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 22px 60px rgba(20, 20, 24, .38);
  animation: rise .18s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.palette__label {
  font-family: Bison, Impact, sans-serif;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  margin: 0;
  padding: .85rem 1.15rem .35rem;
}

.results {
  list-style: none;
  margin: 0;
  padding: .4rem;
  max-height: min(50vh, 24rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.results::-webkit-scrollbar { width: 8px; }
.results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .2);
  border-radius: 999px;
}

.results a {
  display: block;
  padding: .55rem .85rem;
  border-radius: 1.1rem;
  text-decoration: none;
  color: var(--on-dark-soft);
}
.results a:hover { background: rgba(255, 255, 255, .07); }
.results li[aria-selected="true"] a { background: rgba(108, 0, 240, .55); }

.res__g {
  display: inline-block;
  font-family: Bison, Impact, sans-serif;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--purple);
  border-radius: 999px;
  padding: .12rem .6rem;
  margin-bottom: .3rem;
}
.results li[aria-selected="true"] .res__g { background: rgba(255, 255, 255, .22); }

.res__t {
  display: block;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--on-dark);
}
.res__s {
  font-size: .75rem;
  line-height: 1.45;
  color: var(--on-dark-soft);
  margin: .15rem 0 0;
}
.results li[aria-selected="true"] .res__s { color: rgba(255, 255, 255, .82); }

.results mark {
  background: var(--yellow);
  color: var(--ink);
  border-radius: 3px;
  padding: 0 .15em;
}

.results__empty {
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--on-dark-soft);
  margin: 0;
  padding: .95rem 1.15rem;
}

.palette__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: .6rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, .10);
  background: rgba(108, 0, 240, .16);
  font-size: .7rem;
  color: var(--on-dark-soft);
}
.palette__foot kbd {
  font-family: inherit;
  font-size: .7rem;
  line-height: 1;
  color: #fff;
  background: var(--purple);
  border-radius: 999px;
  padding: .18rem .45rem;
  margin-right: .2rem;
}

/* Brief cue on the section you were sent to. */
@keyframes flag {
  from { background: rgba(255, 229, 22, .55); }
  to   { background: transparent; }
}
.is-target > h2 { animation: flag 1.6s ease-out; }

.toc { list-style: none; margin: 0; padding: 0; }
.toc__group {
  font-family: Bison, Impact, sans-serif;
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--grey);
  margin: 1.6rem 0 .5rem;
}
.toc__group:first-child { margin-top: 0; }

.toc a {
  display: block;
  padding: .3rem 0 .3rem .8rem;
  margin-left: -.8rem;
  border-left: 2px solid transparent;
  font-size: .875rem;
  line-height: 1.4;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--purple); }
.toc a[aria-current="true"] {
  color: var(--purple);
  border-left-color: var(--purple);
  font-weight: 700;
}

/* --------------------------------------------------------- mobile nav */

.navbar { display: none; }

/* --------------------------------------------------------- main */

.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4.5rem 3rem 9rem;
}
.main > * { max-width: var(--measure); }

/* --------------------------------------------------------- hero */

.hero { margin-bottom: 3.5rem; }

.eyebrow {
  font-family: Bison, Impact, sans-serif;
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--purple);
  margin: 0 0 .75rem;
}

h1 {
  font-family: Bison, Impact, sans-serif;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: .92;
  letter-spacing: .01em;
  color: var(--ink);
  margin: 0 0 1.25rem;
}
h1 span { color: var(--purple); }

.hero__lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

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

section { scroll-margin-top: 2rem; }

h2 {
  font-family: Bison, Impact, sans-serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--ink);
  margin: 3.5rem 0 1rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--rule);
}
section:first-of-type h2 { border-top: 0; padding-top: 0; margin-top: 0; }

h3 {
  font-family: Geomanist, sans-serif;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.4;
  color: var(--ink);
  margin: 2rem 0 .5rem;
}

p { margin: 0 0 1.1rem; }

a { color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--purple-dark); }

ul, ol { margin: 0 0 1.25rem; padding-left: 1.15rem; }
li { margin-bottom: .45rem; }
li::marker { color: var(--purple); }

strong { font-weight: 700; color: var(--ink); }

/* --------------------------------------------------------- components */

.lede {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 2rem 0 2.5rem;
}
.pillar { background: var(--paper); padding: 1.4rem 1.25rem; }
.pillar__k {
  font-family: Bison, Impact, sans-serif;
  font-size: 2.25rem;
  line-height: 1;
  color: var(--purple);
  display: block;
  margin-bottom: .4rem;
}
.pillar__v { font-size: .875rem; line-height: 1.45; color: var(--grey); margin: 0; }

.callout {
  border-left: 3px solid var(--purple);
  background: var(--wash);
  padding: 1.25rem 1.4rem;
  margin: 1.75rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout--note { border-left-color: var(--ink); }
.callout__title {
  font-family: Bison, Impact, sans-serif;
  font-size: 1.15rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 .5rem;
}

.table-wrap { overflow-x: auto; margin: 1.5rem 0 2rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}
caption {
  text-align: left;
  font-size: .8125rem;
  color: var(--grey);
  padding-bottom: .6rem;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: .7rem .9rem .7rem 0;
  border-bottom: 1px solid var(--rule);
}
thead th {
  font-family: Bison, Impact, sans-serif;
  font-weight: 400;
  font-size: .95rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}
tbody tr:hover { background: var(--wash); }

.dl { margin: 1.5rem 0 2rem; }
.dl div {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--rule);
}
.dl dt { font-weight: 700; color: var(--ink); margin: 0; }
.dl dd { margin: 0; }

/* Compact variant for use inside a callout. */
.dl--tight { margin: 0 0 1.1rem; }
.dl--tight div {
  grid-template-columns: 11rem 1fr;
  padding: .35rem 0;
  border-bottom-color: rgba(0, 0, 0, .07);
}
.dl--tight div:last-child { border-bottom: 0; }

.meta-line {
  font-size: .8125rem;
  color: var(--grey);
  margin: 2rem 0 0;
}

/* --------------------------------------------------------- footer */

.footer {
  max-width: var(--measure);
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--grey);
}
.footer a { color: var(--grey); }
.footer a:hover { color: var(--purple); }
.footer__brand {
  font-family: Bison, Impact, sans-serif;
  font-size: 1.1rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 .5rem;
}

/* --------------------------------------------------------- responsive */

@media (max-width: 1024px) {
  :root { --sidebar-w: 250px; }
  .sidebar { padding-left: 1.5rem; }
  .finder { padding: 0 2rem 1.5rem; }
  .main { padding: 3.5rem 2rem 8rem; }
}

@media (max-width: 820px) {
  .layout { display: block; }

  .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: .9rem 1.25rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .navbar img { width: 96px; height: auto; display: block; }
  .navbar__toggle {
    font-family: Bison, Impact, sans-serif;
    font-size: 1rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--purple);
    color: #fff;
    border: 0;
    padding: .55rem 1rem;
    cursor: pointer;
  }

  .sidebar {
    position: static;
    display: block;
    width: auto;
    height: auto;
    max-height: none;
    padding: 1.5rem 1.25rem 2rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .sidebar[hidden] { display: none; }
  .sidebar__logo { display: none; }
  .sidebar__scroll { overflow: visible; padding-bottom: 0; }
  .search { margin-top: 0; }

  .main { padding: 2.5rem 1.25rem 7rem; }
  .dl div { grid-template-columns: 1fr; gap: .2rem; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .finder { left: 0; padding: 0 1rem 1rem; }
}

/* --------------------------------------------------------- print */

@media print {
  .sidebar, .navbar, .skip-link, .finder { display: none !important; }
  body { font-size: 10.5pt; color: #000; }
  .main { padding: 0; }
  .main > *, .footer { max-width: none; }
  h2 { page-break-after: avoid; break-after: avoid; }
  table, .callout, .pillars { page-break-inside: avoid; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .is-target > h2 { animation: none; }
}
