/* ==========================================================================
   Alexander Vik — information protection & compliance
   Visual system taken from the "Who guards your Purview?" infographic:
   near-black bands, cream paper, one orange accent, slab-serif display.
   ========================================================================== */

:root {
  --ink:        #17191b;
  --ink-soft:   #24272a;
  --ink-line:   #101112;
  --paper:      #f2efe6;
  --paper-warm: #faf4e9;
  --card:       #ffffff;
  --accent:     #e0762b;
  --accent-dim: #c9641f;
  --text:       #222528;
  --muted:      #5c6165;
  --muted-dark: #9ca1a5;
  --rule:       #d9d4c5;

  --diff-add:   #7ec482;
  --diff-del:   #e2705f;

  --display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --sans:    "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

/* --------------------------------------------------------------- reset -- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; }

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

.wrap-narrow { max-width: 780px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  font-weight: 700;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- eyebrow -- */

.eyebrow {
  margin: 0 0 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
}

.tick {
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--accent);
  margin-right: 13px;
  position: relative;
  top: -1px;
}

.accent { color: var(--accent); }

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

.masthead {
  background: var(--ink);
  padding: 26px 0 22px;
}

.masthead-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  display: block;
  min-width: 0;
}

.brand-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted-dark);
  margin-bottom: 8px;
}

.brand-name {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  color: #f4f1e8;
  line-height: 1;
}

.brand:hover .brand-name { color: var(--accent); }

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

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  background: none;
  border: 1px solid #3a3e42;
  color: #e9e5da;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 9px 14px;
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--accent);
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after  { top: 5px; }

.nav-list {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cdc9bf;
  text-decoration: none;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
}

.nav-list a:hover { color: #fff; border-bottom-color: #4a4e52; }

.nav-list a.is-current {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

.hero {
  background: var(--ink);
  padding: 48px 0 66px;
}

.hero .eyebrow { color: var(--muted-dark); }

.hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.3rem, 5.6vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: #f4f1e8;
  max-width: 17ch;
}

.hero-standfirst {
  margin: 26px 0 0;
  max-width: 62ch;
  font-size: 1.13rem;
  line-height: 1.55;
  color: #b3b7ba;
}

/* ------------------------------------------------------------- listing -- */

.listing { padding: 60px 0 20px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 34px;
}

.section-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: -0.012em;
  color: var(--ink);
  white-space: nowrap;
}

.section-head .rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--rule);
}

.section-count {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* auto-fit, not auto-fill: a single post spans the full row rather than
     sitting in a half-width column with empty space beside it */
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 26px;
}

.card {
  background: var(--card);
  border-top: 3px solid var(--ink);
  padding: 26px 30px 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 18px;
}

.card-num {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.5;
  padding-top: 2px;
}

.card-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.32rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-meta {
  margin: 10px 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-blurb {
  margin: 14px 0 0;
  color: #4c5155;
  font-size: 1.01rem;
  line-height: 1.6;
}

.card-more {
  margin: 18px 0 0;
}

.card-more a {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.card-more a:hover { color: var(--accent-dim); text-decoration: underline; }

.empty { color: var(--muted); font-size: 1.05rem; }

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

.callout-band {
  background: var(--ink);
  margin-top: 70px;
  padding: 40px 0;
}

.callout-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  flex-wrap: wrap;
}

.callout-band p {
  margin: 0;
  color: #b3b7ba;
  font-size: 1.05rem;
  max-width: 62ch;
}

.callout-band strong { color: #f4f1e8; font-weight: 700; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 14px 26px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-dim); color: #fff; }

/* ---------------------------------------------------- post / page head -- */

.post-head,
.page-head {
  background: var(--ink);
  padding: 46px 0 52px;
}

.page-head { padding: 40px 0 44px; }

.post-head .eyebrow,
.page-head .eyebrow { color: var(--muted-dark); }

.post-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  line-height: 1.07;
  letter-spacing: -0.017em;
  color: #f4f1e8;
}

.page-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #f4f1e8;
}

.standfirst {
  margin: 22px 0 0;
  font-size: 1.14rem;
  line-height: 1.55;
  color: #b3b7ba;
  max-width: 58ch;
}

.post-meta {
  margin: 26px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

.post-meta .tag {
  display: inline-block;
  color: var(--accent);
  margin-left: 6px;
}

/* --------------------------------------------------------- post figure -- */

.post-figure {
  margin: 44px 0 0;
  background: var(--card);
  border: 1px solid var(--rule);
}

.post-figure img { width: 100%; }

.post-figure figcaption {
  padding: 14px 18px;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* --------------------------------------------------------------- prose -- */

.prose {
  padding: 46px 0 10px;
  font-size: 1.11rem;
  line-height: 1.72;
  color: var(--ink-soft);
}

.prose > p:first-child {
  font-size: 1.28rem;
  line-height: 1.58;
  color: #15181a;
}

.prose p { margin: 0 0 1.35em; }

.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: -0.014em;
  color: var(--ink);
  margin: 2.3em 0 0.75em;
}

.prose h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.24rem;
  color: var(--ink);
  margin: 2em 0 0.6em;
}

.prose h2 + p, .prose h3 + p { margin-top: 0; }

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--accent); }

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

.prose em { font-style: italic; }

.prose ul, .prose ol {
  margin: 0 0 1.4em;
  padding-left: 1.3em;
}

.prose li { margin: 0 0 0.55em; }

.prose li::marker { color: var(--accent); }

.prose hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 3.2em 0;
}

.prose blockquote {
  margin: 1.8em 0;
  padding: 2px 0 2px 24px;
  border-left: 3px solid var(--accent);
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink);
}

.prose blockquote p:last-child { margin-bottom: 0; }

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

.callout {
  margin: 2em 0;
  padding: 22px 26px;
  background: var(--paper-warm);
  border-left: 4px solid var(--accent);
  font-size: 1.04rem;
  line-height: 1.62;
}

.callout p { margin: 0 0 0.9em; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

.callout-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 10px;
}

/* --------------------------------------------------------------- table -- */

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 1rem;
  background: var(--card);
}

.prose th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 14px 18px;
  vertical-align: bottom;
}

.prose td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  line-height: 1.55;
}

.prose tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- code -- */

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #e7e2d4;
  padding: 0.14em 0.42em;
  border-radius: 2px;
}

.prose pre,
.prose .highlight,
.prose .highlighter-rouge {
  background: var(--ink);
  color: #d5d1c6;
  margin: 2em 0;
  overflow-x: auto;
}

.prose .highlighter-rouge { padding: 6px 0; }
.prose .highlighter-rouge .highlight { margin: 0; }

.prose pre {
  margin: 0;
  padding: 22px 26px;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.65;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* rouge — diff blocks, coloured like the infographic */
.highlight .gi { color: var(--diff-add); }
.highlight .gd { color: var(--diff-del); }
.highlight .gh, .highlight .gu { color: #8d9195; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #e8c39a; }
.highlight .nt, .highlight .na { color: #9fc9e8; }
.highlight .c, .highlight .c1, .highlight .cm { color: #7c8186; font-style: italic; }

/* ----------------------------------------------------------- post foot -- */

.post-foot {
  margin: 20px 0 0;
  padding: 30px 0 0;
  border-top: 3px solid var(--ink);
}

.post-foot .eyebrow { margin-bottom: 14px; }

.backlink {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.backlink:hover { text-decoration: underline; }

/* ----------------------------------------------------------- colophon -- */

.colophon {
  background: var(--ink);
  margin-top: 80px;
  padding: 34px 0;
}

.post .prose + .post-foot { margin-bottom: 0; }

.colophon-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.colophon-note {
  margin: 0;
  color: #a7abae;
  font-size: 0.95rem;
}
.colophon-note strong { color: #f4f1e8; }

.colophon-meta {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

.colophon-meta a { color: var(--muted-dark); text-decoration: none; }
.colophon-meta a:hover { color: var(--accent); }
.colophon-meta span { margin: 0 8px; }

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

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }

  .wrap { padding: 0 20px; }

  .masthead { position: relative; }

  .masthead-inner {
    align-items: center;
    flex-wrap: nowrap;
  }

  .brand { flex: 1 1 auto; }

  /* the tracked caps line wraps to three lines next to the menu button */
  .brand-kicker { display: none; }

  .nav-toggle { display: inline-flex; }

  .nav-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 20;
    flex-direction: column;
    gap: 0;
    background: var(--ink);
    padding: 0 20px 12px;
    border-top: 1px solid #33373a;
  }

  .nav-list.is-open { display: flex; }

  .nav-list li { border-bottom: 1px solid #33373a; }
  .nav-list li:last-child { border-bottom: 0; }

  .nav-list a {
    display: block;
    padding: 16px 0;
    border-bottom: 0;
  }

  .nav-list a.is-current { border-bottom: 0; }

  .hero { padding: 36px 0 46px; }
  .hero-title { max-width: none; }

  .section-head { flex-wrap: wrap; gap: 14px; }
  .section-head .rule { display: none; }

  .card { padding: 22px 22px 24px; }

  .prose { font-size: 1.05rem; padding-top: 34px; }
  .prose > p:first-child { font-size: 1.16rem; }
  .prose h2 { font-size: 1.55rem; }

  .prose pre { padding: 18px; font-size: 0.85rem; }

  .prose table { font-size: 0.95rem; }
  .prose th, .prose td { padding: 12px 12px; }

  .callout-band { padding: 32px 0; }
  .colophon-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}

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