/* ==========================================================================
   e0m.ru — design system
   Перенесено из референса index.html: тёмная/светлая тема, Unbounded + Inter,
   лаймовый акцент, «бенто»-карточки, зерно и мягкие цветные пятна.
   ========================================================================== */

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

:root {
  --bg: #0b0b0d;
  --bg-soft: #121216;
  --ink: #f2f1ec;
  --body-text: #cfcec9;
  --muted: #8f8f98;
  --line: rgba(242, 241, 236, 0.12);
  --lime: #d8ff4a;
  --coral: #ff6b4a;
  --violet: #8b7bff;
  --accent: #d8ff4a;
  --accent-solid: #d8ff4a;
  --on-accent: #101010;
  --accent-soft: rgba(216, 255, 74, 0.4);
  --accent-wash: rgba(216, 255, 74, 0.05);
  --outline: rgba(242, 241, 236, 0.55);
  --hover: rgba(255, 255, 255, 0.035);
  --hover-strong: rgba(255, 255, 255, 0.3);
  --ghost-hover: rgba(255, 255, 255, 0.06);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  --radius: 22px;
  --pad: clamp(20px, 4vw, 56px);
  --font-display: "Unbounded", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Light theme ---------- */
[data-theme="light"] {
  --bg: #f6f4ee;
  --bg-soft: #edeae1;
  --ink: #17170f;
  --body-text: #38382f;
  --muted: #66665f;
  --line: rgba(20, 20, 15, 0.14);
  --accent: #5c7a00;
  --accent-solid: #d8ff4a;
  --on-accent: #14150c;
  --accent-soft: rgba(92, 122, 0, 0.35);
  --accent-wash: rgba(92, 122, 0, 0.07);
  --outline: rgba(20, 20, 15, 0.45);
  --hover: rgba(20, 20, 15, 0.045);
  --hover-strong: rgba(20, 20, 15, 0.25);
  --ghost-hover: rgba(20, 20, 15, 0.06);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42));
}

[data-theme="light"] .grain { opacity: 0.035; }
[data-theme="light"] .blob { opacity: 0.22; filter: blur(100px) saturate(0.9); }
[data-theme="light"] h1 em {
  background: linear-gradient(100deg, #4d6b00, #c2410f 55%, #5a4bc4);
  -webkit-background-clip: text;
  background-clip: text;
}
[data-theme="light"] .card--violet {
  background: radial-gradient(120% 120% at 100% 0%, rgba(139, 123, 255, 0.2), transparent 60%), var(--bg-soft);
}
[data-theme="light"] .card--coral {
  background: radial-gradient(120% 120% at 0% 100%, rgba(255, 107, 74, 0.18), transparent 60%), var(--bg-soft);
}
[data-theme="light"] .manifesto-inner {
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(139, 123, 255, 0.14), transparent 55%),
    radial-gradient(80% 100% at 0% 100%, rgba(92, 122, 0, 0.1), transparent 55%),
    var(--bg-soft);
}

body,
#site-header,
.card,
.tool,
.post-card,
.btn,
.chip,
.hero-art,
.manifesto-inner,
.exp-toggle,
.theme-toggle,
.nav-toggle,
.go,
details.exp summary,
.marquee,
.foot-row,
.section-head h2,
h1,
.card p,
.exp-body,
.exp-date,
.num-caption,
.input {
  transition: background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease, background 0.45s ease;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button,
input,
select,
textarea { font: inherit; }

::selection { background: var(--lime); color: #111; }

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

* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--hover-strong); }

/* ---------- Texture & ambience ---------- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: drift 22s ease-in-out infinite alternate;
}
.blob--1 { width: 46vw; height: 46vw; left: -14vw; top: -12vw; background: radial-gradient(circle, var(--violet), transparent 65%); }
.blob--2 { width: 38vw; height: 38vw; right: -10vw; top: 22vh; background: radial-gradient(circle, var(--coral), transparent 65%); animation-delay: -7s; }
.blob--3 { width: 42vw; height: 42vw; left: 30vw; bottom: -24vw; background: radial-gradient(circle, var(--lime), transparent 68%); opacity: 0.22; animation-delay: -13s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, -3vh, 0) scale(1.12); }
}

.wrap {
  width: min(1240px, 100%);
  margin-inline: auto;
  padding-inline: var(--pad);
  position: relative;
  z-index: 1;
}
.wrap--narrow { width: min(880px, 100%); }
.wrap--text { width: min(820px, 100%); }

.page {
  padding: clamp(40px, 6vw, 84px) 0 clamp(60px, 8vw, 110px);
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease, background 0.4s ease;
}
#site-header.scrolled { border-color: var(--line); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 74px;
  position: relative;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 14px;
  white-space: nowrap;
}
.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: conic-gradient(from 140deg, var(--lime), var(--coral), var(--violet), var(--lime));
  box-shadow: 0 0 24px rgba(216, 255, 74, 0.35);
  flex: 0 0 auto;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 13.5px;
  color: var(--muted);
}
.nav-links a { position: relative; transition: color 0.25s; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); }
.btn--solid:hover { filter: brightness(1.06); }
.btn--ghost:hover { background: var(--ghost-hover); border-color: var(--hover-strong); }
.btn--danger { background: var(--coral); border-color: var(--coral); color: #14150c; }
.btn--danger:hover { filter: brightness(1.06); }
.btn--soft { background: var(--bg-soft); }
.btn--sm { padding: 8px 14px; font-size: 12.5px; }
.btn .arrow { transition: transform 0.25s ease; }
.btn:hover .arrow { transform: translate(3px, -3px); }

/* Theme toggle */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle,
.nav-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.theme-toggle:hover { border-color: var(--hover-strong); transform: rotate(-12deg); }
.theme-toggle .theme-icon { grid-area: 1 / 1; width: 18px; height: 18px; }
.theme-icon--sun { display: none; }
[data-theme="light"] .theme-icon--sun { display: block; }
[data-theme="light"] .theme-icon--moon { display: none; }
.nav-toggle { display: none; font-size: 20px; }
.nav-toggle:hover { border-color: var(--hover-strong); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(60px, 9vw, 130px) 0 clamp(50px, 7vw, 100px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(216, 255, 74, 0.14);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(216, 255, 74, 0.14); }
  50% { box-shadow: 0 0 0 8px rgba(216, 255, 74, 0.04); }
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 6.6vw, 86px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
}
h1 .outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--outline);
  display: inline-block;
}
h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--lime), var(--coral) 55%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  max-width: 48ch;
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 17px);
  margin: 0 0 24px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--muted);
}
.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.hero-meta span b { color: var(--ink); font-weight: 500; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Hero visual (portrait) */
.hero-art {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
  isolation: isolate;
}
.hero-art img.portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.12) contrast(1.04) saturate(0.95);
  transform: scale(1.01);
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 10, 12, 0.34) 0%, rgba(10, 10, 12, 0) 42%);
  opacity: 0;
  transition: opacity 0.45s ease;
}
[data-theme="dark"] .hero-art::before { opacity: 1; }
.hero-art:hover img.portrait { transform: scale(1.05); }
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 11, 13, 0) 35%, rgba(11, 11, 13, 0.82) 100%),
    radial-gradient(90% 70% at 100% 0%, rgba(139, 123, 255, 0.32), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(216, 255, 74, 0.14), transparent 60%);
  pointer-events: none;
}
.photo-meta {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 2;
}
.photo-meta strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 2vw, 22px);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: #f2f1ec;
}
.photo-meta span { font-size: 12.5px; color: rgba(242, 241, 236, 0.7); letter-spacing: 0.04em; }
.status {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(10, 10, 12, 0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  color: #f2f1ec;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}
.badge-ring {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 116px;
  height: 116px;
  z-index: 2;
  animation: spin 24s linear infinite;
  opacity: 0.9;
  color: #f2f1ec;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line);
  padding: 18px 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background: var(--bg-soft);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: scroll-x 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 300;
  letter-spacing: 0.06em;
  padding-inline: 28px;
  color: var(--muted);
  white-space: nowrap;
}
.marquee-track span b { color: var(--ink); font-weight: 600; }
.marquee-track span i { color: var(--accent); font-style: normal; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
section { position: relative; z-index: 1; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 4vw, 52px);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-head h2 small {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}
.section-head p { color: var(--muted); max-width: 40ch; margin: 0; font-size: 14.5px; }

/* Bento */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  padding-bottom: clamp(60px, 8vw, 120px);
}
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 26px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.45s, background 0.45s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent-soft); }
.card h3 { font-family: var(--font-display); font-weight: 400; font-size: 20px; margin: 0 0 10px; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }
.card p + p { margin-top: 10px; }
.card .kicker {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  display: block;
}
.card--wide { grid-column: span 4; }
.card--half { grid-column: span 3; }
.card--third { grid-column: span 2; }
.card--tall { grid-row: span 2; }
.card--accent {
  background: linear-gradient(140deg, rgba(216, 255, 74, 0.95), rgba(180, 220, 40, 0.85));
  color: #14150c;
  border-color: transparent;
}
.card--accent p,
.card--accent .kicker { color: rgba(20, 21, 12, 0.72); }
.card--accent h3 { color: #14150c; }
.card--violet { background: radial-gradient(120% 120% at 100% 0%, rgba(139, 123, 255, 0.4), transparent 60%), var(--bg-soft); }
.card--coral { background: radial-gradient(120% 120% at 0% 100%, rgba(255, 107, 74, 0.32), transparent 60%), var(--bg-soft); }

.big-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(46px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  display: block;
}
.num-caption { color: var(--muted); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color 0.25s, border-color 0.25s;
}
.card:hover .chip { color: var(--ink); border-color: var(--hover-strong); }
.chips--tight { margin-top: 14px; }

.link-out {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.link-out:hover { border-color: var(--accent); }
.card--accent .link-out { color: #14150c; border-color: rgba(20, 21, 12, 0.35); }
.card--accent .link-out:hover { border-color: #14150c; }

/* ---------- Experience ---------- */
.exp-section { padding-bottom: clamp(50px, 7vw, 100px); }
.exp-list { border-top: 1px solid var(--line); }
details.exp { border-bottom: 1px solid var(--line); }
details.exp summary {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: baseline;
  gap: 24px;
  padding: 26px 12px;
  cursor: pointer;
  list-style: none;
  transition: background 0.3s ease, padding-inline 0.3s ease;
}
details.exp summary::-webkit-details-marker { display: none; }
details.exp summary:hover { background: var(--hover); padding-inline: 22px; }
.exp-date { font-family: var(--font-display); font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.exp-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(18px, 2.2vw, 25px); letter-spacing: -0.01em; }
.exp-title small { display: block; font-family: var(--font-body); font-size: 13px; color: var(--muted); letter-spacing: 0; margin-top: 6px; }
.exp-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: background 0.3s, color 0.3s, transform 0.3s, border-color 0.3s;
  font-size: 18px;
  line-height: 1;
}
details.exp summary:hover .exp-toggle { border-color: var(--hover-strong); }
details.exp[open] .exp-toggle { background: var(--accent-solid); color: var(--on-accent); border-color: var(--accent-solid); transform: rotate(45deg); }
details.exp .exp-body {
  padding: 0 12px 30px 226px;
  color: var(--muted);
  font-size: 14.5px;
  animation: fade-in 0.4s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.exp-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.exp-body li { position: relative; padding-left: 22px; }
.exp-body li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.exp-body b { color: var(--ink); font-weight: 500; }
.exp-body a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.exp-body a:hover { border-color: var(--accent); }

/* ---------- Tools ---------- */
.tools { padding-bottom: clamp(50px, 7vw, 100px); }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tool {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.45s, background 0.45s;
}
.tool:hover { transform: translateY(-4px); border-color: var(--accent-soft); background: var(--accent-wash); }
.tool .tool-no { font-family: var(--font-display); font-size: 11px; color: var(--muted); letter-spacing: 0.14em; }
.tool h4 { font-family: var(--font-display); font-weight: 400; font-size: 19px; margin: 22px 0 6px; }
.tool p { color: var(--muted); font-size: 13px; margin: 0; }
.tool .tool-foot { display: flex; justify-content: space-between; align-items: center; }
.tool .tool-foot span { color: var(--muted); font-size: 12px; }
.tool .go {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  transition: background 0.3s, color 0.3s, transform 0.3s, border-color 0.3s;
}
.tool:hover .go { background: var(--accent-solid); color: var(--on-accent); border-color: var(--accent-solid); transform: rotate(45deg); }

/* ---------- Manifesto ---------- */
.manifesto { padding: clamp(20px, 4vw, 50px) 0 clamp(60px, 8vw, 120px); }
.manifesto-inner {
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: clamp(30px, 5vw, 72px);
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(139, 123, 255, 0.22), transparent 55%),
    radial-gradient(80% 100% at 0% 100%, rgba(216, 255, 74, 0.14), transparent 55%),
    var(--bg-soft);
}
.manifesto p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(22px, 3.2vw, 40px);
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 30ch;
}
.manifesto p .dim { color: var(--muted); }
.manifesto p .hi { color: var(--accent); }
.manifesto-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- Footer / CTA ---------- */
footer#contact { position: relative; z-index: 1; padding-bottom: 40px; }
.cta {
  text-align: center;
  padding: clamp(50px, 8vw, 110px) 0 clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--line);
}
.cta h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 5.4vw, 70px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 26px;
}
.cta a.mail {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 32px);
  font-weight: 300;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--accent);
  transition: color 0.3s, letter-spacing 0.3s;
}
.cta a.mail:hover { color: var(--accent); letter-spacing: 0.02em; }
.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.foot-row nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-row a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* ==========================================================================
   Content pages: blog, forms, auth, profile, tools
   ========================================================================== */

/* ---------- Blog list ---------- */
.post-list { display: grid; gap: 16px; }
.post-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: clamp(20px, 3vw, 32px);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.45s, background 0.45s;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--accent-soft); }
.post-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-card__meta .kicker { color: var(--accent); }
.post-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(21px, 2.6vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.post-card h2 a { transition: color 0.25s; }
.post-card h2 a:hover { color: var(--accent); }
.post-card__intro { color: var(--muted); font-size: 14.5px; }
.post-card__intro p { margin: 0; }
.post-card__intro p + p { margin-top: 8px; }
.post-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Single post ---------- */
.post { max-width: 900px; margin-inline: auto; }
.post.card { padding: clamp(22px, 4vw, 44px); }
.post--full { max-width: none; }
.post-head { margin-bottom: clamp(24px, 3vw, 38px); }
.post-head h1 {
  font-size: clamp(32px, 5vw, 58px);
  margin: 18px 0 16px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.post-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.prose {
  color: var(--body-text);
  font-size: 16px;
  overflow-wrap: break-word;
}
.post-intro {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
  margin: 0 0 1.4em;
}
.post-intro p { margin: 0; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 1.6em 0 0.6em;
}
.prose h1 { font-size: clamp(28px, 4vw, 40px); }
.prose h2 { font-size: clamp(24px, 3.2vw, 32px); }
.prose h3 { font-size: clamp(20px, 2.4vw, 25px); }
.prose h4 { font-size: 19px; }
.prose p { margin: 0 0 1em; }
.prose a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.prose a:hover { border-color: var(--accent); }
.prose strong,
.prose b { color: var(--ink); font-weight: 600; }
.prose small { font-size: 13px; }
.prose ul,
.prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose img,
.prose video,
.prose canvas,
.prose iframe {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.prose canvas { width: 100%; background: var(--bg-soft); }
.prose figure { margin: 1.5em 0; }
.prose figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}
.prose pre {
  background: #0d0d10;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  overflow-x: auto;
  margin: 1.4em 0;
  color: #e9e8e3;
}
.prose pre code { padding: 0; border: 0; background: transparent; color: inherit; font-size: 13px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 14px; }
.prose th,
.prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { color: var(--ink); font-weight: 500; }
.prose input,
.prose textarea,
.prose select { font: inherit; }
.prose .upload-form { max-width: 100%; }

/* ---------- Forms ---------- */
.form-card { padding: clamp(22px, 3vw, 36px); }
.form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; }
.field > label,
.field > .label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.input,
.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="search"],
.form input[type="file"],
.form textarea,
.form select,
.upload-form input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
  color: var(--ink);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
}
.input:focus,
.form input:focus,
.form textarea:focus,
.form select:focus,
.upload-form input:focus {
  border-color: var(--accent);
  background: var(--bg-soft);
}
.input::placeholder,
.form textarea::placeholder { color: var(--muted); opacity: 0.7; }
.form textarea { min-height: 120px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.form-hint { color: var(--muted); font-size: 12.5px; margin: 0; }

/* CodeMirror */
.CodeMirror {
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  height: 420px !important;
  font-family: var(--font-mono) !important;
  font-size: 13px;
}
.CodeMirror-focused { border-color: var(--accent) !important; }

/* ---------- Auth / profile ---------- */
.auth { max-width: 540px; margin: 0 auto; text-align: center; }
.auth h1 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 14px; }
.auth .lead { color: var(--muted); font-size: 14.5px; margin: 0 0 24px; }
.auth .notice {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--accent-wash);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
}
.auth-form { display: grid; gap: 14px; justify-items: center; }
.auth .fineprint { color: var(--muted); font-size: 12.5px; margin: 22px 0 0; }

.profile { max-width: 760px; margin: 0 auto; }
.profile-head {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.profile-head h1 { font-size: clamp(26px, 3.6vw, 40px); margin: 0 0 6px; }
.profile-head p { color: var(--muted); margin: 0; font-size: 14px; }
.profile-list { display: grid; gap: 0; margin: 0; }
.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.profile-row dt { color: var(--muted); font-size: 13.5px; }
.profile-row dd { margin: 0; text-align: right; font-size: 14px; word-break: break-word; }
.profile-section-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 28px 0 8px;
}
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* ---------- 404 / alerts ---------- */
.error-page { max-width: 720px; margin: 0 auto; text-align: center; }
.error-page h1 { font-size: clamp(30px, 5vw, 54px); }
.error-art { max-width: 420px; margin: 0 auto 28px; }
.alert {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 22px;
  margin: 0 0 18px;
  background: var(--card-bg);
}
.alert h2,
.alert h3 { font-family: var(--font-display); font-weight: 400; font-size: 18px; margin: 0 0 6px; }
.alert p { margin: 0; color: var(--muted); font-size: 14px; }
.alert--danger { border-color: rgba(255, 107, 74, 0.5); background: rgba(255, 107, 74, 0.1); }
.alert--danger h2,
.alert--danger h3 { color: var(--ink); }
.error-page ul { text-align: left; max-width: 460px; margin: 14px auto; color: var(--muted); }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }

/* ---------- Tools: logs, OCR ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.log-card { padding: 0; }
.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.log-head h2,
.log-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 17px; margin: 0; }
.log-body { max-height: 540px; overflow: auto; padding: 12px; }
.log-body .list-group-item { font-size: 13px; }
.log-body .list-group-item .badge { margin-right: 6px; }

.upload-form { display: grid; gap: 18px; }
.dropzone {
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
  padding: 34px 22px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--accent-wash);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}
.dropzone:hover { border-color: var(--accent-soft); background: var(--hover); }
.dropzone strong { color: var(--ink); font-weight: 500; }
.dropzone input[type="file"] { max-width: 100%; border: 0; background: transparent; padding: 0; }

.ocr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ocr-grid .card { padding: 18px; }
.ocr-text {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--body-text);
  margin: 0;
}
.ocr-image img { border-radius: 12px; }

.error-text { color: var(--coral); }

/* ==========================================================================
   Legacy content compatibility
   Старые записи блога и инструменты хранят Bootstrap-классы в БД.
   Слой ниже даёт им аккуратный вид без подключения Bootstrap.
   ========================================================================== */
:where(.prose, .legacy) .container {
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
}
:where(.prose, .legacy) .row { display: flex; flex-wrap: wrap; gap: 16px; }
:where(.prose, .legacy) [class*="col-"] { flex: 1 1 260px; min-width: 0; }

:where(.prose, .legacy) .card { padding: 0; }
:where(.prose, .legacy) .card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  font-family: var(--font-display);
  font-size: 15px;
}
:where(.prose, .legacy) .card-header h5 { margin: 0; font-size: 16px; }
:where(.prose, .legacy) .card-body { padding: 20px; }
:where(.prose, .legacy) .card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

:where(.prose, .legacy) .list-group { display: grid; gap: 0; margin: 0; }
:where(.prose, .legacy) .list-group-flush { border-radius: 0; }
:where(.prose, .legacy) .list-group-item {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: color-mix(in srgb, var(--bg-soft) 65%, transparent);
  color: var(--body-text);
  overflow-wrap: anywhere;
}
:where(.prose, .legacy) .list-group-item:first-child { border-radius: 12px 12px 0 0; }
:where(.prose, .legacy) .list-group-item:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 12px 12px; }
:where(.prose, .legacy) .list-group-item-action { transition: background 0.2s; }
:where(.prose, .legacy) .list-group-item-action:hover { background: var(--hover); }
:where(.prose, .legacy) .list-group-item-success { background: rgba(74, 222, 128, 0.1); }
:where(.prose, .legacy) .list-group-item-danger { background: rgba(255, 107, 74, 0.12); }
:where(.prose, .legacy) .list-group-item-warning { background: rgba(255, 209, 102, 0.1); }
:where(.prose, .legacy) .list-group-item-info { background: rgba(139, 123, 255, 0.1); }

:where(.prose, .legacy) .badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
:where(.prose, .legacy) .bg-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); }
:where(.prose, .legacy) .bg-secondary { background: var(--bg-soft); color: var(--ink); }
:where(.prose, .legacy) .bg-success { background: #4ade80; border-color: #4ade80; color: #10200f; }
:where(.prose, .legacy) .bg-danger { background: var(--coral); border-color: var(--coral); color: #1b0b08; }
:where(.prose, .legacy) .bg-warning { background: #ffd166; border-color: #ffd166; color: #191307; }
:where(.prose, .legacy) .bg-info { background: var(--violet); border-color: var(--violet); color: #0d0a1d; }
:where(.prose, .legacy) .text-dark { color: #14150c !important; }
:where(.prose, .legacy) .text-white { color: #fff !important; }
:where(.prose, .legacy) .text-muted { color: var(--muted) !important; }
:where(.prose, .legacy) .text-danger { color: var(--coral) !important; }

:where(.prose, .legacy) .btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); }
:where(.prose, .legacy) .btn-outline-primary { border-color: var(--accent-soft); color: var(--accent); }
:where(.prose, .legacy) .btn-outline-primary:hover,
:where(.prose, .legacy) .btn-outline-primary.btn-primary { background: var(--accent-solid); color: var(--on-accent); border-color: var(--accent-solid); }
:where(.prose, .legacy) .btn-outline-secondary { border-color: var(--line); color: var(--ink); }
:where(.prose, .legacy) .btn-warning { background: #ffd166; border-color: #ffd166; color: #191307; }
:where(.prose, .legacy) .btn-danger { background: var(--coral); border-color: var(--coral); color: #1b0b08; }
:where(.prose, .legacy) .btn-secondary { background: var(--bg-soft); border-color: var(--line); color: var(--ink); }
:where(.prose, .legacy) .btn-sm { padding: 7px 13px; font-size: 12.5px; }

:where(.prose, .legacy) .form-control,
:where(.prose, .legacy) .form-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 80%, transparent);
  color: var(--ink);
  font-size: 14.5px;
  outline: none;
}
:where(.prose, .legacy) .form-control:focus { border-color: var(--accent); }
:where(.prose, .legacy) .form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

:where(.prose, .legacy) .d-flex { display: flex; }
:where(.prose, .legacy) .d-none { display: none !important; }
:where(.prose, .legacy) .justify-content-between { justify-content: space-between; }
:where(.prose, .legacy) .justify-content-center { justify-content: center; }
:where(.prose, .legacy) .align-items-center { align-items: center; }
:where(.prose, .legacy) .align-items-start { align-items: flex-start; }
:where(.prose, .legacy) .flex-column { flex-direction: column; }
:where(.prose, .legacy) .flex-wrap { flex-wrap: wrap; }
:where(.prose, .legacy) .gap-1 { gap: 4px; }
:where(.prose, .legacy) .gap-2 { gap: 8px; }
:where(.prose, .legacy) .gap-3 { gap: 16px; }
:where(.prose, .legacy) .ms-1 { margin-left: 4px; }
:where(.prose, .legacy) .ms-2 { margin-left: 8px; }
:where(.prose, .legacy) .me-1 { margin-right: 4px; }
:where(.prose, .legacy) .me-2 { margin-right: 8px; }
:where(.prose, .legacy) .me-auto { margin-right: auto; }
:where(.prose, .legacy) .mb-0 { margin-bottom: 0; }
:where(.prose, .legacy) .mb-2 { margin-bottom: 8px; }
:where(.prose, .legacy) .mb-3 { margin-bottom: 16px; }
:where(.prose, .legacy) .mb-4 { margin-bottom: 24px; }
:where(.prose, .legacy) .mt-2 { margin-top: 8px; }
:where(.prose, .legacy) .mt-3 { margin-top: 16px; }
:where(.prose, .legacy) .mt-4 { margin-top: 24px; }
:where(.prose, .legacy) .p-0 { padding: 0; }
:where(.prose, .legacy) .p-2 { padding: 8px; }
:where(.prose, .legacy) .p-3 { padding: 16px; }
:where(.prose, .legacy) .px-4 { padding-inline: 24px; }
:where(.prose, .legacy) .py-5 { padding-block: 40px; }
:where(.prose, .legacy) .w-100 { width: 100%; }
:where(.prose, .legacy) .small { font-size: 13px; }
:where(.prose, .legacy) .fw-bold { font-weight: 600; }
:where(.prose, .legacy) .text-uppercase { text-transform: uppercase; }
:where(.prose, .legacy) .text-center { text-align: center; }
:where(.prose, .legacy) .text-start { text-align: left; }
:where(.prose, .legacy) .rounded { border-radius: 12px; }
:where(.prose, .legacy) .border { border: 1px solid var(--line); }
:where(.prose, .legacy) .img-fluid { max-width: 100%; height: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .ocr-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { aspect-ratio: 16 / 12; max-width: 560px; width: 100%; }
  .nav-links {
    display: none;
    position: absolute;
    top: 74px;
    left: calc(var(--pad) * -1);
    right: calc(var(--pad) * -1);
    flex-direction: column;
    gap: 4px;
    padding: 16px var(--pad) 22px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
    font-size: 15px;
  }
  .nav-links a { padding: 10px 0; }
  .nav-links a::after { bottom: 6px; }
  .nav.is-open .nav-links { display: flex; }
  .nav-toggle { display: grid; }
  .nav-cta { display: none; }
  .card--wide,
  .card--half,
  .card--third { grid-column: span 6; }
  .card--tall { grid-row: auto; }
  details.exp summary { grid-template-columns: 1fr auto; gap: 10px 16px; }
  details.exp summary .exp-date { grid-column: 1 / -1; }
  details.exp .exp-body { padding-left: 12px; padding-right: 12px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .bento { gap: 12px; }
  .card { padding: 20px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .manifesto p { max-width: none; }
  .tool-grid { grid-template-columns: 1fr; }
  .hero-meta { font-size: 12px; }
  .badge-ring { width: 92px; height: 92px; }
  .post-card__actions .btn { flex: 1 1 auto; }
  .profile-row { flex-direction: column; gap: 4px; }
  .profile-row dd { text-align: left; }
}

/* ---------- Motion preferences & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .grain,
  .ambient,
  #site-header,
  footer#contact,
  .theme-toggle,
  .nav-toggle,
  .post-foot { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border-color: #ccc; background: #fff; }
}
