/* Stepan Ziniakov — Books. Palette taken from the cover of «Місто на виріст». */
:root {
  --paper: #fbf6ee;      /* cover ground */
  --paper-2: #f3ece0;
  --ink: #1f1d1b;
  --ink-2: #4f4943;      /* secondary text, >=7:1 on paper */
  --forest: #2f4a3c;
  --forest-2: #3c5a49;
  --sage: #5d7a64;
  --terra: #bf6a4f;
  --ochre: #d8aa6c;
  --slate: #9aadb9;
  --plum: #5a4a50;
  --rule: #ddd3c3;
  --focus: #b15a3f;

  --display: "Literata", Georgia, "Times New Roman", serif;
  --ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--display); font-optical-sizing: auto;
  font-size: clamp(1.0625rem, 1rem + .25vw, 1.1875rem); line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
[tabindex="-1"]:focus { outline: none; }
.skip {
  position: absolute; left: 8px; top: -100px; z-index: 10; background: var(--ink); color: var(--paper);
  padding: 10px 14px; font-family: var(--ui); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------------------------------------------------------------- masthead */
.masthead { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(28px, 5vw, 64px); }
.mast-name { margin: 0 0 clamp(28px, 5vw, 56px); font-family: var(--ui); font-size: .875rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--ink-2); }
.page-h {
  margin: 0; font-weight: 300; font-variation-settings: "opsz" 72; letter-spacing: -.02em;
  font-size: clamp(2.25rem, 1.5rem + 3.6vw, 4.5rem); line-height: 1;
  padding-bottom: clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--ink);
}

/* -------------------------------------------------------------------- work */
.work {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px); align-items: end; padding-bottom: clamp(56px, 8vw, 112px);
}
.work-cover img {
  width: 100%;
  box-shadow: 0 1px 0 rgba(0,0,0,.12), 0 28px 50px -24px rgba(40, 30, 20, .45), 0 6px 14px rgba(40, 30, 20, .12);
}
.work-titles { margin: 0; font-weight: 400; font-variation-settings: "opsz" 72; letter-spacing: -.02em; }
.w-title { display: block; text-wrap: balance; }
.w-title-uk { font-size: clamp(2.75rem, 1.6rem + 4.6vw, 5.5rem); line-height: .98; }
.w-title-es, .w-title-ca {
  font-size: clamp(1.375rem, 1.1rem + 1.1vw, 2rem); line-height: 1.2; font-style: italic; font-weight: 300;
  color: var(--ink-2); letter-spacing: -.01em;
}
.w-title-es { margin-top: .9em; }
.work-subs { margin-top: clamp(24px, 3vw, 36px); max-width: 46ch; border-left: 2px solid var(--terra); padding-left: 18px; }
.work-subs p { margin: 0 0 .55em; font-size: 1rem; line-height: 1.45; color: var(--ink-2); }
.work-subs p:first-child { color: var(--ink); }
.work-subs p:last-child { margin-bottom: 0; }

.toggle ul { display: inline-flex; margin: clamp(28px, 4vw, 44px) 0 0; padding: 3px; list-style: none; border: 1px solid var(--ink); border-radius: 999px; }
.toggle a {
  display: block; padding: 9px 18px; border-radius: 999px; font-family: var(--ui); font-size: .9375rem;
  font-weight: 500; text-decoration: none; min-height: 44px; line-height: 26px;
}
.toggle a:hover { background: var(--paper-2); }

/* ---------------------------------------------------------------- editions */
.editions { padding-bottom: clamp(64px, 9vw, 128px); }
.editions-h {
  margin: 0; font-family: var(--ui); font-weight: 500; font-size: .875rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2);
}
.plan { display: block; width: 100%; height: auto; }
.plan-blocks > * { mix-blend-mode: multiply; opacity: .92; }
.plan-windows rect { fill: var(--paper); }
.plan-lot { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 7 6; }
.plan-ground { stroke: var(--ink); stroke-width: 2; }
.plan-divider { width: 132px; margin: 18px 0 20px; }

.ed {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px);
  padding: clamp(32px, 4vw, 48px) 0; border-top: 1px solid var(--rule);
  scroll-margin-top: 16px; position: relative;
}
.ed:target::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--terra);
}
.ed-cover img, .ed-cover .tcover { width: 100%; box-shadow: 0 16px 30px -18px rgba(40, 30, 20, .5), 0 2px 6px rgba(40,30,20,.1); }
.ed-lang { margin: 0 0 8px; font-family: var(--ui); font-size: .8125rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.ed-title { margin: 0; font-weight: 400; font-variation-settings: "opsz" 60; font-size: clamp(1.625rem, 1.25rem + 1.5vw, 2.375rem); line-height: 1.1; letter-spacing: -.015em; text-wrap: balance; }
.ed-author { margin: 6px 0 0; font-style: italic; color: var(--ink-2); }
.ed-summary { margin: 16px 0 0; max-width: 62ch; text-wrap: pretty; hyphens: auto; }
.ed-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 600px; margin-top: 24px; }
.ed-note { margin: 12px 0 0; font-family: var(--ui); font-size: .8125rem; color: var(--ink-2); }

.dl {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; align-items: baseline;
  padding: 14px 16px; text-decoration: none; border-radius: 3px; min-height: 72px;
  transition: background-color .15s ease, border-color .15s ease;
}
.dl-fmt { grid-row: 1 / span 2; align-self: center; font-family: var(--display); font-variation-settings: "opsz" 72; font-size: 1.75rem; font-weight: 500; line-height: 1; }
.dl-label { font-family: var(--ui); font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.dl-meta { font-family: var(--ui); font-size: .8125rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.dl-pdf { background: var(--forest); color: var(--paper); border: 1px solid var(--forest); }
.dl-pdf .dl-meta { color: #d5dcd2; }
.dl-pdf:hover { background: var(--forest-2); }
.dl-epub { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.dl-epub .dl-meta { color: var(--ink-2); }
.dl-epub:hover { background: var(--paper-2); }

/* ------------------------------------------------------------------ footer */
.foot { padding-top: 24px; padding-bottom: 32px; font-family: var(--ui); font-size: .875rem; color: var(--ink-2); }
.foot p { margin: 0; padding-top: 24px; border-top: 1px solid var(--rule); }

/* ------------------------------------------------------- typographic cover */
.tcover {
  aspect-ratio: 1529 / 2048; background: var(--paper); color: var(--ink); container-type: inline-size;
  display: grid; grid-template-rows: auto 1fr auto; align-items: center;
  padding: 10% 9% 9%; position: relative; overflow: hidden;
  outline: 1px solid rgba(31,29,27,.08); outline-offset: -1px;
}
.tcover::before { content: ""; position: absolute; top: 0; bottom: 0; left: 3.2%; width: 1px; background: rgba(31,29,27,.07); }
.tcover-title { margin: 0; font-family: var(--display); font-weight: 400; font-variation-settings: "opsz" 72; font-size: 12.4cqi; line-height: 1.02; letter-spacing: -.02em; text-align: center; text-wrap: balance; }
.tcover .plan { margin: 4cqi 0; }
.tcover-author { margin: 0; text-align: center; font-family: var(--display); font-size: 6.6cqi; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 899px) {
  .work { grid-template-columns: 1fr; align-items: start; }
  .work-cover { width: 62%; max-width: 360px; }
}
@media (max-width: 599px) {
  .ed { grid-template-columns: 96px minmax(0, 1fr); column-gap: 18px; row-gap: 0; }
  .ed-body { display: contents; }
  .ed-cover { grid-column: 1; grid-row: 1 / span 3; }
  .ed-lang, .ed-title, .ed-author { grid-column: 2; }
  .ed-summary, .ed-dl, .ed-note { grid-column: 1 / -1; }
  .ed-summary { margin-top: 20px; }
  .ed-dl { grid-template-columns: 1fr; }
  .toggle ul { display: flex; width: 100%; }
  .toggle li { flex: 1; }
  .toggle a { text-align: center; padding: 9px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --------------------------------------------- social image (local only) */
.og-body { margin: 0; width: 1200px; height: 630px; overflow: hidden; }
.og { display: grid; grid-template-columns: 1fr 560px; gap: 56px; align-items: center; height: 630px; padding: 0 72px; }
.og-author { margin: 0 0 28px; font-family: var(--ui); font-size: 20px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.og-title { margin: 0 0 14px; font-variation-settings: "opsz" 72; font-size: 32px; line-height: 1.12; letter-spacing: -.015em; font-style: italic; font-weight: 300; color: var(--ink-2); }
.og-title:first-of-type { font-size: 64px; line-height: 1; margin-bottom: 24px; font-style: normal; font-weight: 400; color: var(--ink); }
.og-free { margin: 28px 0 0; font-family: var(--ui); font-size: 20px; font-weight: 600; color: var(--forest); }
.og-covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.og-c img, .og-c .tcover { width: 100%; box-shadow: 0 18px 32px -16px rgba(40,30,20,.5), 0 2px 6px rgba(40,30,20,.12); }
