/* =========================================================
   EKTS — editorial red theme
   ========================================================= */
:root {
  --red-950: #2a0409;
  --red-900: #420710;
  --red-800: #640b19;
  --red-700: #8a0f22;
  --red-600: #b0142c;
  --red-500: #d71c36;
  --red-200: #f2c6cc;
  --red-100: #f9e6e8;
  --paper: #fbf8f6;
  --paper-2: #f4eeeb;
  --ink: #1a1214;
  --ink-2: #3a2e30;
  --muted: #6e6062;
  --line: #e7dcd9;
  --white: #ffffff;

  --font-display: "Unbounded", "Segoe UI", Arial, sans-serif;
  --font-text: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif: "PT Serif", Georgia, "Times New Roman", serif;

  --wrap: 1200px;
  --col: 740px;
  --gutter: 24px;
  --radius: 2px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

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

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

a { color: var(--red-600); }

::selection { background: var(--red-600); color: var(--white); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--red-600);
  color: var(--white);
  padding: 10px 16px;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ---------- Reading progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red-700), var(--red-500));
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 246, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-top: 4px solid var(--red-600);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.08em;
}
.brand-tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 2px;
  background: var(--red-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
a.nav-link:hover,
a.nav-link:focus-visible { color: var(--red-600); }
a.nav-link:hover::after,
a.nav-link:focus-visible::after { transform: scaleX(1); }

/* Non-clickable item: same look, no interaction */
.nav-link.is-static { cursor: default; user-select: none; }

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--white);
  flex-shrink: 0;
}
.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.lang a:hover { color: var(--red-600); }
.lang a[aria-current="page"] {
  background: var(--red-600);
  color: var(--white);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(215, 28, 54, 0.55), transparent 60%),
    radial-gradient(900px 600px at -10% 120%, rgba(42, 4, 9, 0.85), transparent 60%),
    linear-gradient(135deg, var(--red-800) 0%, var(--red-900) 100%);
}
.hero::before {
  /* fine engraving lines */
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.035) 0 1px,
    transparent 1px 14px
  );
  pointer-events: none;
}
.hero::after {
  /* oversized hryvnia glyph watermark */
  content: "₴";
  position: absolute;
  right: -2%;
  bottom: -28%;
  font-family: var(--font-display);
  font-size: 520px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: 64px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 84px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-200);
}
.kicker::before {
  content: "";
  width: 36px;
  height: 2px;
  background: var(--red-500);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero h1 .h1-lead {
  display: block;
  margin-bottom: 14px;
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--red-200);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}
.meta-item { display: inline-flex; align-items: center; gap: 8px; }
.meta-item svg { width: 16px; height: 16px; color: var(--red-200); flex-shrink: 0; }
.meta time { color: var(--white); font-weight: 600; }

/* Cover frame */
.cover {
  margin: 0;
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 440px;
}
.cover::before {
  /* offset red outline */
  content: "";
  position: absolute;
  inset: 22px -22px -22px 22px;
  border: 2px solid var(--red-500);
  pointer-events: none;
}
.cover .frame {
  position: relative;
  background: var(--white);
  padding: 12px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
}
.cover .frame-media {
  aspect-ratio: 1200 / 1228;
  overflow: hidden;
  background: var(--red-950);
}
.cover .frame-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.cover-corner {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 44px;
  height: 44px;
  border-top: 4px solid var(--red-500);
  border-left: 4px solid var(--red-500);
  pointer-events: none;
}

/* ---------- Article ---------- */
.article {
  padding: 80px 0 40px;
}
.article-body {
  max-width: var(--col);
  margin: 0 auto;
}

.article-body p {
  margin: 0 0 1.35em;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.72;
  color: var(--ink);
  hyphens: auto;
}

.article-body .lead {
  font-family: var(--font-text);
  font-size: 21px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink-2);
}
.article-body .lead::first-letter {
  float: left;
  margin: 6px 12px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 66px;
  line-height: 0.9;
  color: var(--red-600);
}

.article-body h2 {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  margin: 2.2em 0 1em;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(21px, 2.3vw, 27px);
  line-height: 1.28;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.article-body h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 72px;
  height: 3px;
  background: var(--red-600);
}
.article-body h2 .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  background: var(--red-600);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}

/* Quotes */
.quote {
  position: relative;
  margin: 2em 0;
  padding: 30px 32px 30px 88px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 6px solid var(--red-600);
}
.quote::before {
  content: "«";
  position: absolute;
  left: 22px;
  top: 10px;
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: var(--red-600);
}
.quote p {
  margin: 0;
  font-family: var(--font-text);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
}

/* Contribution list */
.contrib {
  list-style: none;
  counter-reset: c;
  margin: 1.6em 0 2em;
  padding: 0;
  border-top: 1px solid var(--line);
}
.contrib li {
  counter-increment: c;
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}
.contrib li::before {
  content: counter(c, decimal-leading-zero);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 40px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--red-600);
  background: var(--red-100);
  border: 1px solid var(--red-200);
}

/* Inline figures */
.figure {
  margin: 2.4em 0;
}
.figure .frame {
  position: relative;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -24px rgba(66, 7, 16, 0.45);
}
.figure .frame::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 64px;
  height: 64px;
  border-top: 3px solid var(--red-600);
  border-left: 3px solid var(--red-600);
  pointer-events: none;
}
.figure .frame-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.figure .frame-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* Wide figure bleeds slightly beyond the text column on desktop */
@media (min-width: 1000px) {
  .figure--wide { margin-left: -90px; margin-right: -90px; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 80px;
  color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(180deg, var(--red-900) 0%, var(--red-950) 100%);
  border-top: 6px solid var(--red-600);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 56px;
  padding-top: 64px;
  padding-bottom: 48px;
}
.site-footer .brand { color: var(--white); }
.site-footer .brand-tag { color: rgba(255, 255, 255, 0.6); }

.about h2 {
  margin: 28px 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-200);
}
.about p {
  margin: 0;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.7;
}

.footer-side h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-200);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-nav .nav-link {
  height: 40px;
  padding: 0 16px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.footer-nav .nav-link::after { display: none; }
.footer-nav a.nav-link:hover,
.footer-nav a.nav-link:focus-visible {
  color: var(--white);
  background: var(--red-600);
  border-color: var(--red-600);
}

.contact {
  margin-top: 26px;
  font-size: 15px;
}
.contact a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 2px;
}
.contact a:hover { border-bottom-color: var(--red-500); }
.contact svg { width: 18px; height: 18px; color: var(--red-200); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
.footer-bottom .lang { background: transparent; border-color: rgba(255, 255, 255, 0.2); }
.footer-bottom .lang a { color: rgba(255, 255, 255, 0.7); }
.footer-bottom .lang a:hover { color: var(--white); }
.footer-bottom .lang a[aria-current="page"] { color: var(--white); }

/* ---------- Focus ---------- */
a:focus-visible {
  outline: 2px solid var(--red-500);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
    padding-top: 56px;
    padding-bottom: 72px;
  }
  .cover { justify-self: center; max-width: 420px; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .header-inner {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding-top: 10px;
  }
  .lang { margin-left: auto; }
  .site-header .nav {
    order: 3;
    width: 100%;
    margin: 0;
    padding: 4px 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--line);
  }
  .site-header .nav::-webkit-scrollbar { display: none; }
  .nav-link { padding: 0 12px; font-size: 13px; }
  .nav-link::after { left: 12px; right: 12px; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .brand-tag { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 17px; }
  .hero::after { font-size: 320px; bottom: -14%; }
  .hero-grid { padding-top: 40px; padding-bottom: 64px; }
  .cover { max-width: calc(100% - 22px); justify-self: start; }
  .article { padding-top: 52px; }
  .article-body p { font-size: 18px; }
  .article-body .lead { font-size: 19px; }
  .article-body .lead::first-letter { font-size: 54px; }
  .article-body h2 { grid-template-columns: 1fr; gap: 12px; }
  .article-body h2 .num { width: 46px; }
  .quote { padding: 64px 20px 22px 22px; }
  .quote::before { left: 20px; top: 6px; font-size: 60px; }
  .quote p { font-size: 19px; }
  .contrib li { grid-template-columns: 46px 1fr; gap: 12px; font-size: 16px; }
  .contrib li::before { width: 46px; height: 36px; font-size: 13px; }
  .figure .frame { padding: 6px; }
  .footer-grid { padding-top: 48px; padding-bottom: 36px; }
}

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

@media print {
  .site-header, .progress, .lang { display: none; }
  .hero { background: none; color: var(--ink); }
  .hero::before, .hero::after { display: none; }
}
