/* kauffman.com.ua — light editorial theme: paper + azure */

:root {
  color-scheme: light;

  /* Palette */
  --bg: #eef2f5;
  --surface: #ffffff;
  --raised: #f3f7fa;
  --raised-2: #e7edf2;
  --line: #d6dee5;
  --line-strong: #93a6b2;

  --text: #33424d;
  --heading: #14202b;
  --muted: #5a6b7a;
  --faint: #7c8b98;

  --accent: #0f6fd6;
  --accent-hover: #0b58ab;
  --accent-visited: #4d5fa0;
  --accent-soft: rgba(15, 111, 214, 0.08);
  --accent-line: rgba(15, 111, 214, 0.35);

  --second: #b3261e;
  --second-soft: rgba(179, 38, 30, 0.08);

  --selection: rgba(15, 111, 214, 0.18);
  --focus: #0f6fd6;

  /* Typography */
  --f-head: "Onest", "Inter", "Segoe UI", system-ui, Arial, sans-serif;
  --f-body: "Literata", Georgia, "Times New Roman", serif;
  --f-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-xs: 0.8125rem;
  --fs-h1: 1.375rem;
  --fs-h2: 1.25rem;
  --fs-h3: 1.0625rem;
  --lh-body: 1.75;
  --lh-head: 1.3;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  /* Shape */
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 12px;
  --bw: 1px;
  --border: var(--bw) solid var(--line);

  /* Layout */
  --wrap: 1160px;
  --measure: 70ch;
  --gutter: var(--s-4);
  --tap: 44px;
  --ease: 160ms ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
  background: var(--bg);
  scrollbar-color: var(--line-strong) var(--bg);
  scrollbar-width: thin;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(20, 32, 43, 0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--selection); color: var(--heading); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #7c8fa0; }

img, video, svg, canvas, picture, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}
img, video { border-radius: var(--r); filter: brightness(0.92); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-head);
  color: var(--heading);
  line-height: var(--lh-head);
  font-weight: 700;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--ease), text-decoration-color var(--ease), background-color var(--ease), border-color var(--ease);
}
a:visited { color: var(--accent-visited); }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Forms */
input, textarea, select, button {
  font: inherit;
  color: var(--text);
}
input, textarea, select {
  width: 100%;
  min-height: var(--tap);
  padding: var(--s-2) var(--s-3);
  background: var(--raised);
  border: var(--border);
  border-radius: var(--r);
  color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus-visible, textarea:focus-visible, select:focus-visible { border-color: var(--accent); outline-offset: 1px; }
textarea { min-height: 120px; resize: vertical; }

button, .btn, input[type="submit"], input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  width: auto;
  padding: var(--s-2) var(--s-5);
  background: var(--raised-2);
  color: var(--heading);
  border: var(--bw) solid var(--line-strong);
  border-radius: var(--r);
  font-family: var(--f-head);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent-hover); }
button:active, .btn:active { background: var(--accent); color: #17130a; border-color: var(--accent); }

/* Layout helpers */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: var(--s-3);
}
.skip:focus, .skip:focus-visible {
  left: var(--s-3);
  z-index: 300;
  padding: var(--s-2) var(--s-4);
  background: var(--raised-2);
  color: var(--heading);
  border: var(--bw) solid var(--accent);
  border-radius: var(--r);
  text-decoration: none;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(21, 27, 24, 0.96);
  border-top: 2px solid var(--accent);
  border-bottom: var(--border);
}
@supports (backdrop-filter: blur(6px)) {
  .topbar { background: rgba(21, 27, 24, 0.88); backdrop-filter: blur(6px); }
}

.topbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  min-height: 60px;
  padding-top: var(--s-2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--tap);
  color: var(--heading);
  text-decoration: none;
  font-family: var(--f-head);
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand:visited { color: var(--heading); }
.brand:hover { color: var(--heading); }
.brand-mark {
  color: var(--accent);
  display: inline-flex;
}

.menu {
  order: 3;
  width: 100%;
  display: flex;
  gap: var(--s-1);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter) var(--s-1);
  font-family: var(--f-head);
  font-weight: 500;
  font-size: 0.9375rem;
  border-top: var(--border);
}
.menu::-webkit-scrollbar { display: none; }
.menu a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--s-3);
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.menu a:visited { color: var(--muted); }
.menu a:hover { color: var(--heading); }
.menu a[aria-current="page"] {
  color: var(--heading);
  border-bottom-color: var(--accent);
}

.lang {
  display: flex;
  gap: var(--s-1);
  padding: 2px;
  background: var(--bg);
  border: var(--border);
  border-radius: var(--r);
  font-family: var(--f-head);
  font-size: var(--fs-small);
}
.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: 40px;
  padding: 0 var(--s-2);
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lang a:visited { color: var(--muted); }
.lang a:hover { color: var(--heading); background: var(--raised); }
.lang a[aria-current="true"] {
  color: #17130a;
  background: var(--accent);
  font-weight: 700;
}

/* Post head */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-2);
  margin: var(--s-6) 0 var(--s-4);
  font-family: var(--f-head);
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.5;
}
.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

.post-head { max-width: var(--measure); }
.post-head h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  max-width: 34ch;
}

.post-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: var(--s-4) 0 var(--s-6);
  padding-top: var(--s-3);
  border-top: var(--border);
  font-family: var(--f-head);
  font-size: var(--fs-small);
  color: var(--muted);
}

/* Cover */
.cover {
  max-width: var(--wrap);
  margin: 0 auto var(--s-7);
  padding: 0 var(--gutter);
}
.cover img {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: var(--r-lg);
  border: var(--border);
  background: var(--raised);
}

/* Layout */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
}

/* TOC */
.toc {
  font-family: var(--f-head);
  font-size: var(--fs-small);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
}
.toc-title {
  font-weight: 700;
  color: var(--heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--fs-xs);
  margin-bottom: var(--s-3);
}
.toc ol {
  list-style: none;
  display: grid;
  gap: var(--s-1);
  counter-reset: toc;
}
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: var(--s-2);
  align-items: baseline;
  min-height: var(--tap);
  padding: var(--s-2) 0;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  border-left: 2px solid transparent;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  flex: 0 0 auto;
}
.toc a:visited { color: var(--muted); }
.toc a:hover { color: var(--heading); }

/* Article */
.post {
  min-width: 0;
  max-width: calc(var(--measure) + 2 * var(--s-7));
  background: var(--surface);
  border: var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-4);
}
.post > :first-child { margin-top: 0; }
.post > :last-child { margin-bottom: 0; }

.post p { margin-bottom: 1.25em; }
.post .intro {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--heading);
  padding-bottom: var(--s-5);
  margin-bottom: var(--s-5);
  border-bottom: var(--border);
}

.post h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: var(--s-7) 0 var(--s-4);
  padding-top: var(--s-5);
  border-top: var(--border);
  position: relative;
}
.post h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
}
.post h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin: var(--s-6) 0 var(--s-3);
}
.post h4 {
  font-size: 1rem;
  margin: var(--s-5) 0 var(--s-2);
  color: var(--text);
}

/* Lists */
.post ul, .post ol {
  margin: 0 0 1.25em;
  padding-left: var(--s-5);
}
.post li { margin-bottom: var(--s-2); padding-left: var(--s-1); }
.post li::marker { color: var(--accent); }
.post ol li::marker { font-family: var(--f-head); font-weight: 700; font-size: 0.9em; }
.post ul { list-style: square; }
.post li > ul, .post li > ol { margin: var(--s-2) 0 0; }
.post ul ul { list-style: circle; }

/* Summary card */
.summary {
  background: var(--raised);
  border: var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-2) 0 var(--s-5);
}
.summary-title {
  font-family: var(--f-head);
  font-weight: 700;
  color: var(--heading);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s-2) !important;
}
.summary p:last-child { margin-bottom: 0; }

/* Definition list */
.terms {
  display: grid;
  gap: var(--s-3);
  margin: 0 0 var(--s-5);
}
.terms div {
  padding: var(--s-3) var(--s-4);
  background: var(--raised);
  border: var(--border);
  border-radius: var(--r);
}
.terms dt {
  font-family: var(--f-head);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--s-1);
}
.terms dd { color: var(--muted); }

/* Blockquote */
.post blockquote, blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-4) var(--s-5);
  background: var(--raised);
  border: var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--muted);
}
.post blockquote p {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-style: italic;
  color: var(--text);
}
.post blockquote p + p { margin-top: var(--s-3); }
blockquote cite { display: block; margin-top: var(--s-3); font-size: var(--fs-small); color: var(--muted); font-style: normal; font-family: var(--f-head); }

/* Code */
code, kbd, samp, pre { font-family: var(--f-mono); font-size: 0.875em; }
:not(pre) > code {
  padding: 0.1em 0.4em;
  background: var(--raised-2);
  border: var(--border);
  border-radius: var(--r-sm);
  color: var(--accent-hover);
  overflow-wrap: anywhere;
}
pre {
  margin: var(--s-5) 0;
  padding: var(--s-4);
  background: #131b24;
  border: var(--border);
  border-radius: var(--r);
  overflow-x: auto;
  line-height: 1.6;
  color: #e6edf3;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
kbd {
  display: inline-block;
  padding: 0.05em 0.45em;
  background: var(--raised-2);
  border: var(--bw) solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  color: var(--heading);
  font-size: 0.8em;
  line-height: 1.5;
}

/* Tables */
.table-wrap, .post .table {
  overflow-x: auto;
  margin: var(--s-5) 0;
  border: var(--border);
  border-radius: var(--r);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: var(--s-5) 0;
}
.post table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  border: var(--border);
  border-radius: var(--r);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { margin: 0; border: 0; display: table; }
th, td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--border);
  min-width: 120px;
}
th {
  background: var(--raised-2);
  color: var(--heading);
  font-family: var(--f-head);
  font-weight: 600;
  font-size: var(--fs-small);
  white-space: nowrap;
}
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: 0; }
caption { caption-side: bottom; padding: var(--s-2); color: var(--muted); font-size: var(--fs-small); }

/* Misc */
hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: var(--s-7) 0;
}
figure { margin: var(--s-6) 0; }
figure img { border: var(--border); }
figcaption {
  margin-top: var(--s-2);
  font-family: var(--f-head);
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.5;
}
small { font-size: var(--fs-small); color: var(--muted); }
mark {
  background: rgba(214, 171, 94, 0.22);
  color: var(--heading);
  padding: 0 0.2em;
  border-radius: 2px;
}
strong, b { font-weight: 700; color: var(--heading); }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.2em; }

/* Read also */
.more {
  margin-top: var(--s-8);
  padding: var(--s-7) 0;
  background: var(--surface);
  border-top: var(--border);
  border-bottom: var(--border);
}
.more h2 {
  font-size: var(--fs-h2);
  margin-bottom: var(--s-5);
}
.more-list {
  list-style: none;
  border-top: var(--border);
}
.more-list li { border-bottom: var(--border); }
.more-list a {
  display: grid;
  gap: var(--s-1) var(--s-5);
  padding: var(--s-4) var(--s-2);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--r-sm);
}
.more-list a:visited { color: var(--text); }
.more-list a:hover { background: var(--raised); }
.more-list a:hover .more-name { color: var(--accent); }
.more-topic {
  font-family: var(--f-head);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.more-topic.is-threat { color: var(--second); }
.more-name {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--heading);
  line-height: 1.35;
  transition: color var(--ease);
}
.more-desc { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }

/* Footer */
.foot {
  background: var(--raised);
  color: var(--muted);
  font-family: var(--f-head);
  font-size: var(--fs-small);
  border-top: var(--border);
}
.foot-row {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding-top: var(--s-6);
  padding-bottom: var(--s-6);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
  align-items: center;
}
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--text);
  text-decoration: none;
}
.foot a:visited { color: var(--text); }
.foot a:hover { color: var(--accent); text-decoration: underline; }
.dmca {
  min-height: 32px !important;
  padding: 2px var(--s-3);
  border: var(--bw) solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
}
.foot a.dmca:hover { border-color: var(--accent); text-decoration: none; }

/* ≥480px */
@media (min-width: 480px) {
  :root { --gutter: 20px; --fs-h1: 1.5rem; }
  .post { padding: var(--s-6) var(--s-5); }
}

/* ≥768px */
@media (min-width: 768px) {
  :root {
    --gutter: var(--s-6);
    --fs-h1: 1.75rem;
    --fs-h2: 1.375rem;
    --fs-h3: 1.125rem;
  }
  .topbar-row { flex-wrap: nowrap; gap: var(--s-5); min-height: 68px; padding-top: 0; }
  .brand { margin-right: 0; }
  .menu {
    order: 0;
    width: auto;
    margin: 0 auto 0 0;
    padding: 0;
    border-top: 0;
  }
  .menu a { min-height: 66px; }
  .post { padding: var(--s-7); }
  .post .intro { font-size: 1.1875rem; }
  .more-list a {
    grid-template-columns: 120px 240px minmax(0, 1fr);
    align-items: baseline;
    padding: var(--s-5) var(--s-3);
  }
  .foot-row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }
}

/* ≥1024px */
@media (min-width: 1024px) {
  :root {
    --fs-body: 1.125rem;
    --fs-h1: 1.875rem;
    --fs-h2: 1.5rem;
    --fs-h3: 1.1875rem;
  }
  .post-layout {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: var(--s-7);
  }
  .toc {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: transparent;
    border: 0;
    border-left: var(--border);
    border-radius: 0;
    padding: 0 0 0 var(--s-4);
  }
  .toc a {
    min-height: 0;
    padding: var(--s-1) 0 var(--s-1) var(--s-3);
    margin-left: calc(-1 * var(--s-4) - 1px);
    padding-left: calc(var(--s-4) - 1px);
  }
  .toc a:hover { border-left-color: var(--accent); }
  .lang a { min-height: 34px; min-width: 40px; }
}

/* ≥1280px */
@media (min-width: 1280px) {
  .post-layout { grid-template-columns: 250px minmax(0, 1fr); gap: var(--s-8); }
}

@media (hover: none) {
  .lang a { min-height: var(--tap); }
}

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

@media print {
  body { background: #fff; color: #111; }
  .topbar, .toc, .more, .foot, .skip { display: none; }
  .post { border: 0; background: none; padding: 0; }
}