/* styles.css — spigel.km.ua — "Warm Graphite & Amber" editorial dark theme */

:root {
  color-scheme: dark;

  /* Palette: warm graphite + muted amber, secondary sage */
  --bg: #121316;
  --bg-deep: #0f1012;
  --surface: #18191d;
  --raised: #1f2025;
  --raised-2: #26282e;
  --border: #2d2f35;
  --border-strong: #3a3d44;

  --text: #dedbd4;
  --text-strong: #f0ede6;
  --muted: #a8a49b;
  --subtle: #8f8b83;

  --accent: #d6a45e;
  --accent-hover: #e6b976;
  --accent-visited: #c49a73;
  --accent-soft: rgba(214, 164, 94, 0.12);
  --accent-line: rgba(214, 164, 94, 0.45);

  --accent2: #93b5a2;
  --accent2-soft: rgba(147, 181, 162, 0.12);

  --focus: #f1c98a;
  --selection-bg: rgba(214, 164, 94, 0.32);
  --selection-text: #fbf7ef;

  /* Typography */
  --font-main: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif Pro", "Georgia", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;

  --fs-base: 16.5px;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;
  --fs-lead: 1.08rem;
  --fs-h1: 1.375rem;
  --fs-h2: 1.25rem;
  --fs-h3: 1.1rem;
  --fs-h4: 1rem;
  --lh-body: 1.72;
  --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 */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --bw: 1px;

  /* Layout */
  --container: 1160px;
  --measure: 68ch;
  --gutter: 16px;
  --header-h: 60px;

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --dur: 0.18s;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: var(--fs-base);
  scroll-behavior: smooth;
  scrollbar-color: var(--border-strong) var(--bg-deep);
  scrollbar-width: thin;
  background-color: var(--bg);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(214, 164, 94, 0.035) 0, transparent 360px),
    radial-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px;
  background-attachment: scroll;
  color: var(--text);
  font-family: var(--font-main);
  font-weight: 400;
  line-height: var(--lh-body);
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

/* Scrollbar (WebKit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: #4a4d55;
}
::-webkit-scrollbar-corner {
  background: var(--bg-deep);
}

/* ---------- Media ---------- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img,
video {
  border-radius: var(--radius);
  filter: brightness(0.93);
}

svg {
  flex-shrink: 0;
}

iframe {
  max-width: 100%;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
}

figure {
  margin: var(--s-6) 0;
}

figcaption {
  margin-top: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.55;
  padding-left: var(--s-3);
  border-left: 2px solid var(--border-strong);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-strong);
  font-weight: 650;
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5,
h6 { font-size: 0.95rem; }

p {
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

a:visited {
  color: var(--accent-visited);
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
}

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

:focus:not(:focus-visible) {
  outline: none;
}

strong,
b {
  font-weight: 650;
  color: var(--text-strong);
}

em,
i {
  font-style: italic;
}

small {
  font-size: var(--fs-sm);
  color: var(--muted);
}

mark {
  background: rgba(214, 164, 94, 0.22);
  color: var(--text-strong);
  padding: 0.05em 0.3em;
  border-radius: var(--radius-sm);
}

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
}

sub,
sup {
  font-size: 0.75em;
  line-height: 0;
}

hr {
  border: 0;
  height: var(--bw);
  background: var(--border);
  margin: var(--s-7) 0;
  position: relative;
  overflow: visible;
}

hr::after {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

ul,
ol {
  list-style: none;
}

/* Code */
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: var(--raised-2);
  color: #ecd3ab;
  padding: 0.12em 0.4em;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-deep);
  color: var(--text);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-4);
  margin: var(--s-5) 0;
  line-height: 1.6;
  tab-size: 2;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
  word-break: normal;
  white-space: pre;
}

kbd {
  display: inline-block;
  background: var(--raised);
  color: var(--text-strong);
  border: var(--bw) solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 0.05em 0.45em;
  font-size: 0.8em;
  line-height: 1.5;
}

/* Tables */
table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  border-spacing: 0;
  margin: var(--s-5) 0;
  font-size: var(--fs-sm);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

thead {
  background: var(--raised);
}

th,
td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--bw) solid var(--border);
  min-width: 120px;
}

th {
  color: var(--text-strong);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  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) var(--s-4);
  color: var(--muted);
  font-size: var(--fs-sm);
  text-align: left;
}

/* Forms */
input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
}

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  background: var(--bg-deep);
  color: var(--text);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--s-2) var(--s-3);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
  -webkit-appearance: auto;
  appearance: auto;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle);
  opacity: 1;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #4a4d55;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: auto;
  min-height: 44px;
  padding: var(--s-2) var(--s-5);
  background: var(--raised);
  color: var(--text-strong);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--raised-2);
  border-color: var(--accent);
  color: var(--accent-hover);
}

button:active {
  background: var(--accent);
  color: #1a1408;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

label {
  display: inline-block;
  margin-bottom: var(--s-1);
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 19, 22, 0.94);
  border-bottom: var(--bw) solid var(--border);
}

@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .site-header {
    background: rgba(18, 19, 22, 0.86);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: var(--s-1) var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  color: var(--text-strong);
  font-weight: 750;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  min-width: 0;
}

.logo:visited {
  color: var(--text-strong);
}

.logo:hover {
  color: var(--text-strong);
}

.logo svg,
.logo img {
  width: 28px;
  height: 28px;
  color: var(--accent);
  filter: none;
  border-radius: var(--radius-sm);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.lang-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--s-3);
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: var(--bw) solid transparent;
  border-radius: var(--radius);
}

.lang-switcher a:visited {
  color: var(--muted);
}

.lang-switcher a:hover {
  color: var(--text-strong);
  background: var(--raised);
  border-color: var(--border);
}

.lang-switcher a.active,
.lang-switcher a.active:visited {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

/* ---------- Main ---------- */
main {
  display: block;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter) var(--s-7);
}

.article-title {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-strong);
  max-width: 40ch;
  margin-bottom: var(--s-5);
  padding-top: var(--s-4);
  position: relative;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}

.article-title::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  margin-bottom: var(--s-7);
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-content .lead,
.lead {
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--s-5);
  max-width: var(--measure);
}

.meta-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  font-size: var(--fs-sm);
  color: var(--muted);
  padding-top: var(--s-4);
  border-top: var(--bw) solid var(--border);
}

.meta-info svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.hero-visual {
  position: relative;
  width: 100%;
  height: 240px;
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
}

.visual-texture {
  width: 100%;
  height: 100%;
  background-color: var(--surface);
  background-image:
    linear-gradient(135deg, rgba(214, 164, 94, 0.08), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 0;
  filter: brightness(0.9) saturate(0.95);
}

/* ---------- Article content ---------- */
.content-body {
  max-width: var(--measure);
  margin: 0 0 var(--s-7);
  min-width: 0;
}

.content-body > *:first-child {
  margin-top: 0;
}

.content-body p {
  margin-bottom: var(--s-5);
  color: var(--text);
  font-size: 1rem;
  line-height: var(--lh-body);
}

.content-body h2,
.content-body h3,
.content-body h4 {
  color: var(--text-strong);
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

.content-body h2 {
  font-size: var(--fs-h2);
  margin-top: var(--s-7);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-2);
  border-bottom: var(--bw) solid var(--border);
}

.content-body h3 {
  font-size: var(--fs-h3);
  margin-top: var(--s-6);
  margin-bottom: var(--s-3);
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}

.content-body h3::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-2px);
}

.content-body h4 {
  font-size: var(--fs-h4);
  margin-top: var(--s-5);
  margin-bottom: var(--s-2);
  color: var(--accent2);
  letter-spacing: 0.01em;
}

.content-body a {
  overflow-wrap: anywhere;
}

.content-body blockquote,
blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.04rem;
  line-height: 1.7;
}

.content-body blockquote p,
blockquote p {
  color: inherit;
  margin-bottom: var(--s-3);
}

.content-body blockquote p:last-child,
blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite,
blockquote footer {
  display: block;
  margin-top: var(--s-3);
  font-family: var(--font-main);
  font-style: normal;
  font-size: var(--fs-sm);
  color: var(--subtle);
  background: none;
  border: 0;
}

/* Lists */
.content-body ul,
.content-body ol {
  margin: 0 0 var(--s-5);
  padding-left: var(--s-5);
}

.content-body li {
  position: relative;
  margin-bottom: var(--s-2);
  padding-left: var(--s-1);
  color: var(--text);
  line-height: 1.7;
}

.content-body ul > li {
  list-style: none;
}

.content-body ul > li::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--s-4));
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
}

.content-body ul ul > li::before {
  background: transparent;
  border: 1.5px solid var(--accent2);
  border-radius: 50%;
  transform: none;
}

.content-body ol {
  list-style: decimal;
}

.content-body ol > li {
  list-style: decimal;
  padding-left: var(--s-2);
}

.content-body ol > li::marker {
  color: var(--accent);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.content-body ul ul,
.content-body ul ol,
.content-body ol ul,
.content-body ol ol {
  margin-top: var(--s-2);
  margin-bottom: var(--s-2);
  padding-left: var(--s-5);
}

.content-body ul li strong,
.content-body li strong {
  color: var(--text-strong);
}

.content-body img {
  margin: var(--s-5) 0;
}

/* ---------- Related materials ---------- */
.related-materials {
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: var(--bw) solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
}

.section-header h2,
.section-header h3 {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.divider-line {
  flex: 1 1 auto;
  min-width: 24px;
  height: var(--bw);
  background: var(--border);
}

.cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-4);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--s-5);
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.card:hover {
  background: var(--raised);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card:hover::before {
  transform: scaleX(1);
}

.card:focus-within {
  border-color: var(--accent-line);
}

.card a {
  color: inherit;
  text-decoration: none;
}

.card a:hover h4,
.card:hover h4 {
  color: var(--accent-hover);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  font-size: var(--fs-xs);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--s-2);
  background: var(--accent-soft);
  color: var(--accent);
  border: var(--bw) solid rgba(214, 164, 94, 0.28);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
}

.badge.accent-badge {
  background: var(--accent2-soft);
  color: var(--accent2);
  border-color: rgba(147, 181, 162, 0.3);
}

.date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
}

.card h4 {
  margin-bottom: var(--s-2);
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--text-strong);
  transition: color var(--dur) var(--ease);
}

.card p {
  flex-grow: 1;
  margin-bottom: var(--s-4);
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: var(--s-3);
  border-top: var(--bw) solid var(--border);
  color: var(--subtle);
  transition: color var(--dur) var(--ease);
}

.card:hover .card-footer {
  color: var(--accent);
}

.card-footer svg {
  width: 18px;
  height: 18px;
}

/* ---------- Footer ---------- */
footer {
  margin-top: var(--s-7);
  background: var(--bg-deep);
  border-top: var(--bw) solid var(--border);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-6) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-4);
}

.footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2);
  color: var(--muted);
  font-size: var(--fs-sm);
}

.footer-left svg {
  color: var(--accent);
  width: 20px;
  height: 20px;
}

.footer-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-1) var(--s-2);
}

.footer-center a,
.footer-center a:visited {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s-3);
  color: var(--muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  border-radius: var(--radius);
}

.footer-center a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.dmca-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 36px;
  padding: var(--s-1) var(--s-3);
  background: var(--surface);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  cursor: default;
}

.dmca-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent2);
}

/* ---------- Breakpoints ---------- */
@media (min-width: 480px) {
  :root {
    --gutter: 20px;
    --fs-h1: 1.5rem;
  }

  .hero-visual {
    height: 280px;
  }

  pre {
    padding: var(--s-4) var(--s-5);
  }
}

@media (min-width: 768px) {
  :root {
    --fs-base: 17px;
    --gutter: 32px;
    --fs-h1: 1.7rem;
    --fs-h2: 1.35rem;
    --fs-h3: 1.15rem;
    --fs-lead: 1.12rem;
    --header-h: 68px;
  }

  main {
    padding-top: var(--s-7);
  }

  .hero-visual {
    height: 340px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-5);
  }

  table {
    display: table;
    overflow: visible;
  }

  .table-wrap,
  .table-responsive {
    overflow-x: auto;
  }

  .footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    text-align: left;
  }

  .footer-left {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }
}

@media (min-width: 1024px) {
  :root {
    --fs-base: 17.5px;
    --fs-h1: 1.85rem;
    --fs-h2: 1.4rem;
    --fs-h3: 1.18rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: var(--s-7);
    align-items: stretch;
  }

  .hero-visual {
    height: 100%;
    min-height: 380px;
  }

  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-body {
    margin-left: 0;
  }
}

@media (min-width: 1280px) {
  :root {
    --fs-base: 18px;
    --fs-h1: 1.9rem;
  }

  .hero-visual {
    min-height: 420px;
  }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card:hover {
    transform: none;
  }
}

/* ---------- Print fallback ---------- */
@media print {
  .site-header,
  footer,
  .related-materials {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }
}