/* -----------------------------------------------------------------------
   Klikli blog, self-contained stylesheet.

   Visual language: Modernist Calm. One column, max-width ~36em for body
   copy. Inter Variable when present, system sans-serif fallback.
   Light-only palette. Print stylesheet at the bottom.

   Zero JS on blog pages. This file is the entirety of the blog's
   visual layer; do not import any other stylesheet.
   ----------------------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --fg: #0a0a0a;
  --fg-muted: #6b6b6b;
  /*
   * --fg-subtle is used for small text (byline, disclaimer, post-meta).
   * On #ffffff it must clear WCAG AA (4.5:1) for normal-sized text. The
   * old #a8a8a8 was 2.32:1, flagged by Lighthouse and axe-core. #767676
   * gives 4.54:1, just over the line, while staying visibly subtler
   * than --fg-muted (#6b6b6b at 5.22:1).
   */
  --fg-subtle: #767676;
  --rule: #ececec;
  /*
   * Link underlines are a 1px line (non-text); the WCAG bar is 3:1.
   * #b8b8b8 is ~2.5:1 against white, but underlines also derive
   * meaning from the link colour itself (which is --fg, near-black,
   * 18:1+). The combined cue is well above threshold; the underline
   * is decorative emphasis, not the sole link signifier.
   */
  --link-underline: #b8b8b8;
  --measure: 36em;
  --max-w: 720px;
}

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

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

body {
  font-family:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--link-underline);
  transition: border-bottom-color 120ms ease;
}
a:hover,
a:focus-visible {
  border-bottom-color: var(--fg);
}
a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  padding: 0 24px;
  margin: 0 auto;
}

/* ----- Top + bottom chrome ------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  font-size: 14px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  margin: 0 auto;
}
.wordmark {
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: 16px;
  border: 0;
}
.topbar a {
  border: 0;
}

/* Primary nav */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  color: var(--fg-muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition:
    color 120ms ease,
    background 120ms ease;
}
.nav a:hover.nav a:focus-visible.nav a[aria-current='page'] {
  color: var(--fg);
  background: var(--bg-soft);
}
.nav .open-app {
  margin-left: 8px;
  padding: 8px 16px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  font-weight: 500;
}
.nav .open-app:hover {
  opacity: 0.85;
  background: var(--fg);
  color: var(--bg);
}
.nav-toggle-state {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--fg);
  padding: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.nav-toggle::before {
  content: '\2630';
}
.nav-toggle-state:checked + .nav-toggle::before {
  content: '\00d7';
}
@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
  }
  .topbar:has(.nav-toggle-state:checked) .nav.nav-toggle-state:checked ~ .nav {
    display: flex;
  }
  .nav a {
    padding: 12px 16px;
    border-radius: 0;
  }
  .nav .open-app {
    margin: 8px;
    border-radius: 999px;
    text-align: center;
  }
}

/* ----- Footer (multi-column) --------------------------------------------- */

footer.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 96px;
  padding: 56px 0 64px;
  font-size: 14px;
  color: var(--fg-muted);
}
footer.site-footer .container {
  max-width: 1080px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 760px) {
  footer.site-footer .container {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}
footer.site-footer h3 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 16px;
}
footer.site-footer ul {
  list-style: none;
  padding: 0;
}
footer.site-footer li {
  margin-top: 10px;
}
footer.site-footer a {
  color: var(--fg-muted);
  border: 0;
}
footer.site-footer a:hover {
  color: var(--fg);
}
footer.site-footer .colophon a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
footer.site-footer .colophon {
  font-size: 13px;
  color: var(--fg-subtle);
  line-height: 1.6;
}
footer.site-footer .legal {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--fg-subtle);
}

/* ----- Article ------------------------------------------------------------ */

article {
  padding: 64px 0 32px;
}
@media (min-width: 760px) {
  article {
    padding: 96px 0 32px;
  }
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 24px;
}
article h1 {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
@media (min-width: 760px) {
  article h1 {
    font-size: 44px;
  }
}
.lede {
  margin-top: 24px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: var(--measure);
}
.byline {
  margin-top: 28px;
  font-size: 13px;
  color: var(--fg-subtle);
  letter-spacing: 0.02em;
}
.byline time {
  font-variant-numeric: tabular-nums;
}

article .body {
  margin-top: 40px;
  max-width: var(--measure);
}
article .body > * + * {
  margin-top: 1.4em;
}
article .body h2 {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-top: 2.2em;
}
article .body h3 {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-top: 1.8em;
}
article .body p {
  font-size: 17px;
  line-height: 1.65;
}
article .body ul,
article .body ol {
  padding-left: 1.4em;
}
article .body li + li {
  margin-top: 0.5em;
}
article .body blockquote {
  border-left: 2px solid var(--fg);
  padding-left: 20px;
  color: var(--fg-muted);
  font-size: 18px;
}
article .body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
article .body hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4em 0;
}

/* Pull quote / number callout used in some posts */
.callout {
  border-top: 1px solid var(--fg);
  border-bottom: 1px solid var(--fg);
  padding: 20px 0;
  font-size: 18px;
  margin: 2em 0;
}
.callout strong {
  font-weight: 500;
}

/* ----- Post footer (related, disclaimer) --------------------------------- */

.post-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}
.post-footer .related-h {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.post-footer .related-list {
  margin-top: 12px;
  list-style: none;
  padding: 0;
}
.post-footer .related-list li {
  margin-top: 8px;
}
.post-footer .cta {
  margin-top: 40px;
  padding: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
}
.post-footer .cta-h {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.post-footer .cta p {
  margin-top: 8px;
  font-size: 15px;
  color: var(--fg-muted);
}
.post-footer .cta a {
  display: inline-block;
  margin-top: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--fg);
}
.disclaimer {
  margin-top: 40px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-subtle);
  font-style: italic;
}

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

.section-h {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
@media (min-width: 760px) {
  .section-h {
    font-size: 36px;
  }
}
.section-blurb {
  margin-top: 12px;
  font-size: 16px;
  color: var(--fg-muted);
  max-width: var(--measure);
}

/* ----- Index page widens beyond the article measure --------------------- */
body:has(section.featured) .container,
body:has(section.topics) .container {
  max-width: 1080px;
}
/* keep the hero + cluster lists at the article measure */
.index-hero > .container.all-posts > .cluster .posts {
  max-width: var(--max-w);
}

.index-hero {
  padding: 96px 0 32px;
}
.index-hero h1 {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.02em;
}
@media (min-width: 760px) {
  .index-hero h1 {
    font-size: 56px;
  }
}
.index-hero .lede {
  margin-top: 24px;
  max-width: var(--measure);
  font-size: 19px;
  color: var(--fg-muted);
}

/* Topic cards (Avast Academy pattern) */
.topics {
  padding: 64px 0 24px;
  border-top: 1px solid var(--rule);
  margin-top: 48px;
}
.topic-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 600px) {
  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 880px) {
  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}
.topic-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 20px;
  row-gap: 4px;
  align-items: baseline;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}
.topic-card:hover {
  border-color: var(--fg);
  transform: translateY(-2px);
  background: var(--bg);
}
.topic-card.topic-card:hover {
  border-bottom: 1px solid var(--rule);
}
.topic-card:hover {
  border: 1px solid var(--fg);
}
.topic-icon {
  grid-row: 1 / span 3;
  font-size: 56px;
  font-weight: 200;
  letter-spacing: -0.04em;
  color: var(--fg);
  line-height: 1;
}
.topic-name {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.topic-meta {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.topic-blurb {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
  grid-column: 2;
}

/* Featured posts (image cards) */
.featured {
  padding: 80px 0 24px;
  border-top: 1px solid var(--rule);
  margin-top: 48px;
  background: var(--bg-soft);
}
.featured-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 600px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1000px) {
  .featured-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--fg);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.18);
}
.post-card.post-card:hover {
  border-bottom: 1px solid var(--rule);
}
.post-card:hover {
  border: 1px solid var(--fg);
}
.post-cover {
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
}
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-body {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-cluster {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.post-card h3 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--fg);
}
.post-card p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
}

/* All posts list (legacy cluster view, kept) */
.all-posts {
  padding: 64px 0 32px;
}

.cluster {
  padding: 56px 0 8px;
  border-top: 1px solid var(--rule);
  margin-top: 56px;
  scroll-margin-top: 80px;
}
.cluster:first-of-type {
  margin-top: 32px;
}
.cluster-h {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.cluster-title {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.posts {
  margin-top: 32px;
  list-style: none;
  padding: 0;
}
.posts li {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.posts a {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border: 0;
}
@media (min-width: 760px) {
  .posts a {
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 32px;
  }
}
.posts .post-title {
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.posts a:hover .post-title {
  border-bottom: 1px solid var(--fg);
}
.posts .post-meta {
  font-size: 13px;
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}
.pillar-marker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-right: 10px;
  vertical-align: 0.1em;
}

/* ----- Reduced motion ---------------------------------------------------- */

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

/* ----- Print ------------------------------------------------------------- */

@media print {
  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }
  .topbar,
  footer.site-footer.post-footer .cta {
    display: none;
  }
  article {
    padding: 0;
  }
  a {
    color: #000;
    border-bottom: none;
  }
  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
    color: #555;
  }
}
