/* ==========================================================================
   Keyv — общая дизайн-система сайта.
   Извлечена из дизайн-макета (Claude Design handoff) и адаптирована
   под статический сайт. Подключайте этот файл на каждой новой странице.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --serif: "Instrument Serif", Georgia, serif;
  --grotesk: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  /* акцент по умолчанию (amber) */
  --accent: oklch(0.76 0.15 55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: #f1ece1; }

.page {
  --bg: #15120d;
  --bg-2: #1c1812;
  --line: rgba(245, 240, 230, 0.10);
  --line-2: rgba(245, 240, 230, 0.18);
  --ink: #efe9dc;
  --muted: #9d9686;
  --faint: #6c6557;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--grotesk);
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .4s ease;
}
.page[data-theme="light"] {
  --bg: #f1ece1;
  --bg-2: #f8f4ea;
  --line: rgba(28, 22, 14, 0.12);
  --line-2: rgba(28, 22, 14, 0.22);
  --ink: #1f1a12;
  --muted: #6f6757;
  --faint: #9a9281;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #15120d; }

.page > * { padding-left: clamp(20px, 6vw, 96px); padding-right: clamp(20px, 6vw, 96px); }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; gap: 32px;
  height: 76px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.01em; }
.brand__mark { color: var(--accent); font-size: 13px; }
.brand__name { font-size: 18px; }
.nav { display: flex; gap: 28px; margin-left: 8px; }
.nav a { font-size: 14px; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.status {
  margin-left: auto; display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  transition: border-color .2s, color .2s;
}
.status:hover { border-color: var(--line-2); color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- hero ---------- */
.hero { padding-top: clamp(56px, 10vh, 130px); padding-bottom: clamp(56px, 9vh, 120px); }
.hero__kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  color: var(--muted); text-transform: none; margin-bottom: 30px;
}
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 7vw, 104px); line-height: 1.0; letter-spacing: -.01em;
  max-width: 16ch; text-wrap: balance;
}
.hero__title em { font-style: italic; color: var(--accent); }
.hero__meta {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px); align-items: end;
  margin-top: clamp(40px, 7vh, 84px);
  padding-top: 34px; border-top: 1px solid var(--line);
}
.hero__lead { font-size: clamp(16px, 1.6vw, 20px); line-height: 1.55; color: var(--muted); max-width: 44ch; }
.facts { display: flex; gap: clamp(20px, 3vw, 48px); flex-wrap: wrap; justify-content: flex-end; }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; color: var(--faint); text-transform: uppercase; margin-bottom: 7px; }
.facts dd { font-size: 15px; color: var(--ink); white-space: nowrap; }

/* ---------- section ---------- */
.work { padding-top: clamp(40px, 7vh, 90px); padding-bottom: clamp(60px, 10vh, 140px); }
.work__head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-title { font-family: var(--grotesk); font-weight: 600; font-size: clamp(15px, 1.5vw, 18px); letter-spacing: .01em; }
.section-title .hash { color: var(--accent); margin-right: 4px; }
.work__count { font-family: var(--mono); font-size: 13px; color: var(--faint); }

/* ---------- editorial rows ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) clamp(220px, 26vw, 360px);
  gap: clamp(20px, 3vw, 56px); align-items: start;
  padding: clamp(28px, 4vw, 48px) 0;
  border-top: 1px solid var(--line);
  transition: background .3s ease;
}
.rows .row:last-child { border-bottom: 1px solid var(--line); }
.row:hover { background: color-mix(in oklab, var(--bg-2) 70%, transparent); }
.row__index { font-family: var(--mono); font-size: 14px; color: var(--faint); padding-top: 8px; }
.row__head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.row__name { font-family: var(--grotesk); font-weight: 500; font-size: clamp(28px, 3.4vw, 46px); letter-spacing: -.02em; line-height: 1; }
.row__kind { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.row__desc { font-size: clamp(15px, 1.4vw, 17px); line-height: 1.6; color: var(--muted); max-width: 52ch; }
.row__foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- grid cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(16px, 1.6vw, 24px); }
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; background: color-mix(in oklab, var(--bg-2) 55%, transparent);
  transition: border-color .25s, transform .25s, background .25s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.card .visual { margin-bottom: 18px; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card__name { font-family: var(--grotesk); font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
.card__year { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.card__kind { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .02em; margin-bottom: 12px; }
.card__desc { font-size: 14px; line-height: 1.55; color: var(--muted); margin-bottom: 16px; }
.card__foot { display: flex; flex-direction: column; gap: 14px; margin-top: auto; }

/* ---------- tags + readmore ---------- */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.readmore { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--ink); white-space: nowrap; }
.readmore .arr { color: var(--accent); transition: transform .25s; }
.readmore:hover .arr { transform: translateX(5px); }

/* ---------- visual placeholder ---------- */
.visual {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--bg-2); aspect-ratio: 16 / 10;
}
.row .visual { aspect-ratio: 4 / 3; }
.visual__chrome { display: flex; gap: 6px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.visual__chrome span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.visual__body {
  position: relative; height: calc(100% - 33px); display: grid; place-items: center;
  background-image: repeating-linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 9%, transparent) 0 1px,
    transparent 1px 11px);
}
.visual__label { font-family: var(--mono); font-size: 11px; color: var(--faint); background: color-mix(in oklab, var(--bg) 80%, transparent); padding: 5px 10px; border-radius: 6px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding-top: clamp(48px, 8vh, 96px); padding-bottom: 40px; }
.foot__big { display: flex; flex-direction: column; gap: 8px; margin-bottom: clamp(48px, 9vh, 100px); }
.foot__big > span { font-family: var(--serif); font-size: clamp(28px, 4vw, 56px); color: var(--muted); }
.foot__mail { font-family: var(--serif); font-style: italic; font-size: clamp(34px, 6vw, 88px); line-height: 1; letter-spacing: -.01em; width: max-content; max-width: 100%; border-bottom: 2px solid transparent; transition: border-color .25s; }
.foot__mail:hover { border-color: var(--accent); }
.foot__row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 26px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.foot__copy { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.foot__links { display: flex; gap: 22px; }
.foot__links a { font-family: var(--mono); font-size: 12px; color: var(--muted); transition: color .2s; }
.foot__links a:hover { color: var(--accent); }

/* ---------- buttons (общие, для страниц проектов) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; line-height: 1;
  color: var(--ink); background: color-mix(in oklab, var(--bg-2) 55%, transparent);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 18px; cursor: pointer;
  transition: border-color .25s, transform .25s, background .25s, color .25s;
}
.btn:hover { border-color: var(--line-2); transform: translateY(-2px); }
.btn .ico { color: var(--accent); }
.btn--primary { background: var(--accent); color: #15120d; border-color: transparent; }
.btn--primary .ico { color: #15120d; }
.btn--primary:hover { background: color-mix(in oklab, var(--accent) 88%, #fff); }

/* ---------- prose / content blocks ---------- */
.prose { max-width: 70ch; }
.prose p { font-size: clamp(15px, 1.4vw, 17px); line-height: 1.7; color: var(--muted); margin-bottom: 18px; }
.prose strong { color: var(--ink); font-weight: 600; }
.lede { font-size: clamp(17px, 1.8vw, 22px); line-height: 1.55; color: var(--ink); }

.codeblock {
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  color: var(--ink); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; overflow-x: auto; white-space: pre;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .hero__meta { grid-template-columns: 1fr; align-items: start; gap: 28px; }
  .facts { justify-content: flex-start; }
  .row { grid-template-columns: 36px 1fr; }
  .row .visual { display: none; }
}
@media (max-width: 520px) {
  .status { display: none; }
  .top { gap: 16px; }
}
