/* Case page "Парсер публикаций" on top of haiku.dev styles.css.
   Layout: one 4-column grid for the whole page. Column 1 carries the section
   label (with the logo's three red bars), columns 2–4 the content; figure
   rows, points and steps snap to the same columns and share one hairline.
   Bands alternate: black (demo) → white (task, solution) → black (steps)
   → white with the haiku.dev lines (result) → grey (comment) → red (request)
   → the site's own blocks with tiles of the new cases. */
:root {
  --hk-black: #0F0F0F;   /* site black */
  --hk-ink: #232323;     /* body text */
  --hk-red: #FB3747;     /* accent */
  --hk-red-deep: #E01F2E;/* logo red */
  --hk-grey: #595959;    /* captions on white */
  --hk-soft: #BFBFBF;    /* body text on black */
  --hk-white: #FFFFFF;
  --hk-display: 'Nekst', 'Inter', Arial, sans-serif;
  --hk-text: 'Inter', Arial, sans-serif;
  --gap: 40px;
  --hk-ease: cubic-bezier(.55, .05, .2, 1);
  --band: 140px;
}
.nw { white-space: nowrap; }
a:focus-visible { outline: 2px solid var(--hk-red); outline-offset: 3px; }
/* haiku.dev styles.css gives every link a fixed size (20px, 16px below 1600px, 12px below 1150px):
   links inside running text, captions, breadcrumbs and the messenger line take their text's size */
:is(.pr-text, .pr-quote, .pr-meta, .pr-cta__alt, .art-text, .art-crumbs, .art-fig figcaption, .art-steps) a { font-size: inherit; }

/* Bands */
.pr-band { padding-block: var(--band); --line: var(--hk-black); }
.pr-band--white { background: var(--hk-white); color: var(--hk-ink); }
.pr-band--black { background: var(--hk-black); color: var(--hk-white); --line: rgba(255, 255, 255, 0.18); }
.pr-band--red { background: var(--hk-red); color: var(--hk-white); --line: rgba(255, 255, 255, 0.5); }
.pr-band--black :is(h1, h2, h3, h4), .pr-band--red :is(h1, h2, h3, h4) { color: var(--hk-white); }

/* Grid */
.pr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gap); }
.pr-label { grid-column: 1; min-width: 0; }
.pr-body { grid-column: 2 / -1; min-width: 0; }
.pr-row { margin-top: 96px; }
.pr-divided { margin-top: 120px; padding-top: 120px; border-top: 1px solid var(--line); }

/* Section label with the logo's three bars */
.pr-label__t { font-family: var(--hk-text); font-weight: 600; font-size: 20px; line-height: 1.2; display: flex; align-items: center; }
.pr-label__t--sub { color: var(--hk-grey); padding-top: 34px; }
.pr-mark {
  flex: none; width: 20px; height: 19px; margin-right: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 18.53'%3E%3Cpath fill='%23E01F2E' d='M0 0h14.82v3.71H0zM5.18 7.41H20v3.71H5.18zM0 14.82h9.88v3.71H0z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.pr-band--red .pr-mark { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 18.53'%3E%3Cpath fill='%23FFFFFF' d='M0 0h14.82v3.71H0zM5.18 7.41H20v3.71H5.18zM0 14.82h9.88v3.71H0z'/%3E%3C/svg%3E"); }

/* Type */
.pr-h2 {
  font-family: var(--hk-display); font-weight: 600;
  font-size: 52px; line-height: 1.05; margin: 0 0 40px; max-width: 18em;
  text-wrap: balance; color: inherit;
}
.pr-text { font-size: 20px; line-height: 1.45; max-width: 720px; }
.pr-text p { margin: 0 0 1em; }
.pr-text p:last-child { margin-bottom: 0; }
.pr-band--black .pr-text { color: var(--hk-soft); }

.pr-meta { margin: 48px 0 0; font-size: 16px; line-height: 1.4; }
.pr-meta dt { color: var(--hk-grey); font-size: 14px; margin-top: 20px; }
.pr-meta dt:first-child { margin-top: 0; }
.pr-meta dd { margin: 4px 0 0; max-width: 260px; }

/* Hero: the demo and the case title share one centred stage, sized so both fit the first screen */
/* header 58px + 32px air above the demo; 188px of title and lead and 24px of air below it */
.pr-hero { padding-block: 90px 96px; }
.pr-stage { width: min(100%, max(560px, calc((100svh - 304px) * 1.6))); margin: 0 auto; }
.pr-demo {
  position: relative; width: 100%; aspect-ratio: 1120 / 700;
  border-radius: 5px; overflow: hidden; background: var(--hk-black);
}
.pr-demo iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.pr-hero__head { margin-top: 40px; }
.pr-hero h1 { margin: 0; color: var(--hk-white); font-size: min(76px, 8.5svh); white-space: nowrap; }
.pr-hero__lead {
  margin: 20px 0 0; max-width: 30em;
  font-family: var(--hk-display); font-weight: 600; font-size: 24px; line-height: 1.25; text-wrap: balance;
}

/* Figures: one hairline, a big number, a short label */
.pr-figures { display: grid; column-gap: var(--gap); row-gap: 48px; }
.pr-figures--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pr-figures--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pr-figure { border-top: 1px solid var(--line); padding-top: 32px; min-width: 0; }
.pr-figure__num {
  font-family: var(--hk-display); font-weight: 600; font-size: 80px; line-height: 0.9;
  font-variant-numeric: tabular-nums; white-space: nowrap; margin-bottom: 12px;
}
.pr-figure__num span { font-size: 0.3em; margin-left: 0.15em; }
.pr-figure__num .pr-pre { margin: 0 0.15em 0 0; }
.pr-figure__label { font-size: 20px; line-height: 1.3; max-width: 15em; }
.pr-figure__was { font-size: 16px; margin-top: 10px; opacity: 0.75; }

/* Points of the solution */
.pr-points { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 48px; margin-top: 96px; }
.pr-point { border-top: 1px solid var(--line); padding-top: 32px; min-width: 0; }
.pr-point img { display: block; width: 40px; height: 40px; }
.pr-point h3, .pr-point h4 { margin: 24px 0 12px; }
.pr-point p { margin: 0; font-size: 16px; line-height: 1.45; max-width: 22em; }

/* Steps */
.pr-steps__label {
  display: flex; justify-content: space-between; gap: 24px;
  font-weight: 600; font-size: 20px;
  padding-bottom: 24px; margin: 120px 0 80px;
  border-bottom: 1px solid var(--line);
}
.pr-steps .pr-row + .wrapper .pr-steps__label:first-child, .pr-steps__label:first-child { margin-top: 96px; }
.pr-step { margin-bottom: 120px; align-items: start; }
.pr-step:last-child { margin-bottom: 0; }
.pr-step__text { grid-column: 1; position: sticky; top: 140px; min-width: 0; }
.pr-step__num {
  font-family: var(--hk-display); font-weight: 600; font-size: 72px; line-height: 0.8;
  color: var(--hk-red); margin-bottom: 28px; font-variant-numeric: tabular-nums;
}
.pr-step h3 { margin: 0 0 16px; font-size: 29px; text-wrap: balance; }
.pr-step p { margin: 0; color: var(--hk-soft); font-size: 16px; line-height: 1.5; }
.pr-step__shot { grid-column: 2 / -1; min-width: 0; }
.pr-step__shot img { display: block; width: 100%; height: auto; border-radius: 5px; }

/* Result, the figures beside the text; the haiku.dev lines then lead into the comment (both white) */
.pr-results { padding-bottom: 32px; }
.pr-comment { padding-top: 0; }
.pr-comment .pr-wave { aspect-ratio: 1600 / 400; margin: 0 0 40px; }
.pr-comment .pr-wave .hd-lines { top: -23.75%; }
/* figures in two columns on the left, the text on the right, all hung from one hairline */
.pr-results__row { margin-top: 72px; align-items: start; }
.pr-results__figs { grid-column: 1 / span 2; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 40px; }
.pr-results__figs .pr-figure { padding-top: 24px; }
.pr-results__figs .pr-figure__num { font-size: 80px; margin-bottom: 12px; }
.pr-results__figs .pr-figure__label { font-size: 18px; }
.pr-results__figs .pr-figure__was { font-size: 14px; margin-top: 6px; }
.pr-results__text { grid-column: 3 / -1; min-width: 0; border-top: 1px solid var(--line); padding-top: 24px; }
.pr-results .pr-h2 em { font-style: normal; color: var(--hk-red); }
.pr-results .pr-figure__num { color: var(--hk-red); }
.pr-results .pr-figure__was { color: var(--hk-grey); opacity: 1; }
.pr-wave { position: relative; overflow: hidden; aspect-ratio: 1600 / 420; margin: 24px 0 40px; pointer-events: none; }
.pr-wave .hd-lines { position: absolute; left: 0; top: -22.6%; width: 100%; height: auto; overflow: visible; }
.hd-lines path {
  fill: none; stroke: var(--hk-red); stroke-width: 1;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: hd-draw 10s ease-in-out infinite alternate;
}
@keyframes hd-draw { to { stroke-dashoffset: 0; } }

/* Comment: one carefully set quote on haiku grey */
.pr-band--grey { background: #EDEDED; color: var(--hk-ink); --line: var(--hk-black); }
.pr-comment__fig { margin: 0; }
.pr-quote { margin: 0; }
.pr-quote p {
  margin: 0; max-width: 20em;
  font-family: var(--hk-display); font-weight: 600; font-size: 48px; line-height: 1.12;
  text-indent: -0.42em; text-wrap: pretty; color: var(--hk-black);
}
.pr-q { color: var(--hk-red); }
.pr-quote__by { margin: 40px 0 0; max-width: 960px; text-align: right; font-family: var(--hk-text); font-weight: 600; font-size: 18px; color: var(--hk-black); }

/* Request: the accent band, one heading and one button */
.pr-cta__body { display: flex; flex-direction: column; align-items: center; text-align: center; }
/* the label keeps its place at the left like every other section; heading and button stand in the centre */
.pr-cta__body { position: relative; }
.pr-cta__label { position: absolute; left: 0; top: 12px; margin: 0; }
.pr-cta__body .pr-btn { margin-top: 56px; }
.pr-cta .pr-cta__title { font-size: 64px; max-width: 14em; margin: 0 auto; text-wrap: balance; }
/* the second way in: a plain white line under the button, the link underlined like the site's text links */
.pr-cta__alt { margin: 24px 0 0; font-family: var(--hk-text); font-size: 20px; line-height: 1.4; color: var(--hk-white); }
.pr-cta__alt a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; transition: text-decoration-thickness .2s; }
.pr-cta__alt a:hover { text-decoration-thickness: 2px; }
.pr-btn {
  flex: none; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  height: 62px; padding: 0 48px; border-radius: 5px;
  background: var(--hk-red); color: var(--hk-white);
  font-family: var(--hk-text); font-weight: 600; font-size: 18px; text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.pr-btn:hover { transform: translateY(-1px); }
.pr-btn:active { transform: translateY(1px); }
.pr-btn--white { background: var(--hk-white); color: var(--hk-black); }
.pr-btn--white:hover { background: var(--hk-black); color: var(--hk-white); }
.pr-btn--big { height: 72px; padding: 0 56px; font-size: 20px; }

/* Other cases: the case cards of the Haiku AI landing (ai.haiku.dev) on haiku grey */
.pr-more__head { margin-bottom: 64px; }
.pr-more .pr-h2 { margin: 0; }
.pr-cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pr-case {
  position: relative; isolation: isolate; overflow: hidden; min-width: 0;
  display: flex; flex-direction: column; gap: 12px; min-height: 380px; padding: 28px 26px;
  border-radius: 6px; background: var(--hk-white); color: var(--hk-black); text-decoration: none;
  transition: transform 0.4s var(--hk-ease), box-shadow 0.4s ease, color 0.3s ease, background-color 0.3s ease;
}
.pr-case::before, .pr-case::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.5s ease; pointer-events: none; }
.pr-case::after { background: linear-gradient(180deg, rgba(40, 6, 12, 0.22), rgba(40, 6, 12, 0.12)); }
.pr-case.g1::before { background: url("cases/hover-1.jpg") center / 100% 100% no-repeat; }
.pr-case.g2::before { background: url("cases/hover-2.jpg") center / 100% 100% no-repeat; }
.pr-case.g3::before { background: url("cases/hover-3.jpg") center / 100% 100% no-repeat; }
.pr-case .lines { position: absolute; z-index: -1; left: -10%; width: 120%; height: 60%; bottom: -6%; overflow: visible; pointer-events: none; }
.pr-case .lines path { fill: none; stroke: var(--hk-black); stroke-width: 1; }
.pr-case .lines g { transition: opacity 0.5s ease; }
.pr-case .lines.at-tilt { bottom: -12%; transform: rotate(-10deg) scale(1.1); }
.pr-case .lines.at-corner { height: 46%; bottom: -18%; transform: rotate(-10deg) scale(1.15); }
.pr-case:hover, .pr-case:focus-visible { text-shadow: 0 1px 12px rgba(40, 6, 12, 0.3); transform: translateY(-6px); box-shadow: 0 34px 60px -32px rgba(200, 30, 50, 0.55); color: var(--hk-white); }
.pr-case:hover::before, .pr-case:hover::after, .pr-case:focus-visible::before, .pr-case:focus-visible::after { opacity: 1; }
.pr-case:hover .lines g, .pr-case:focus-visible .lines g { opacity: 0; }
.pr-case .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pr-case .sector { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #5E5E5E; transition: color 0.3s ease; }
.pr-case .arrow { width: 22px; height: 22px; flex: none; transition: transform 0.35s var(--hk-ease); }
.pr-case .arrow path { fill: none; stroke: currentColor; stroke-width: 1.8; }
.pr-case:hover .arrow { transform: translate(3px, -3px); }
.pr-case .metric { font: 600 clamp(30px, 2.8vw, 40px)/1.05 var(--hk-display); font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 18px; }
.pr-case .metric .to { font-family: var(--hk-text); font-weight: 400; }
.pr-case .unit { font-size: 15px; line-height: 1.4; color: #5E5E5E; transition: color 0.3s ease; }
.pr-case p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: #333; max-width: 30ch; transition: color 0.3s ease; }
.pr-case.text-low .metric { margin-top: auto; }
.pr-case:hover .sector, .pr-case:hover .unit, .pr-case:hover p,
.pr-case:focus-visible .sector, .pr-case:focus-visible .unit, .pr-case:focus-visible p { color: var(--hk-white); }
.pr-case--all { background: var(--hk-red); color: var(--hk-white); }
.pr-case--all .sector, .pr-case--all p { color: rgba(255, 255, 255, 0.85); }
.pr-case--all:hover, .pr-case--all:focus-visible { background: var(--hk-red-deep); }
/* reports and the index: black cards among the white case cards, the same red hover */
.pr-case--report { background: var(--hk-black); color: var(--hk-white); }
.pr-case--report .sector, .pr-case--report .unit { color: #A6A6A6; }
.pr-case--report p { color: var(--hk-soft); }
.pr-case--report .lines path { stroke: var(--hk-white); }
/* five cards (a case page: two other cases, three reports): the cases share the first row, the reports the second */
.pr-cases--5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.pr-cases--5 > :nth-child(-n+2) { grid-column: span 3; }
.pr-cases--5 > :nth-child(n+3) { grid-column: span 2; }

@media (min-width: 1801px) {
  .pr-h2 { font-size: 64px; }
  .pr-figure__num { font-size: 100px; }
  .pr-quote p { font-size: 56px; }
  .pr-cta .pr-cta__title { font-size: 80px; }
  .pr-results__figs .pr-figure__num { font-size: 100px; }
}
@media (max-width: 1400px) {
  .pr-cta__label { position: static; align-self: flex-start; margin-bottom: 32px; }
}
@media (max-width: 1150px) {
  :root { --gap: 24px; --band: 100px; }
  .pr-h2 { font-size: 40px; }
  .pr-text { font-size: 18px; }
  .pr-hero h1 { font-size: min(64px, 7.5svh); line-height: 0.95; }
  .pr-figures--4, .pr-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-figure__num { font-size: 56px; }
  .pr-step { margin-bottom: 96px; }
  .pr-step__num { font-size: 56px; }
  .pr-step h3 { font-size: 24px; }
  .pr-quote p { font-size: 36px; }
  .pr-cases, .pr-cases--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-cases--5 > * { grid-column: auto !important; }
  .pr-results__figs .pr-figure__num { font-size: 56px; }
  .pr-results__figs .pr-figure__label { font-size: 16px; }
  .pr-cta .pr-cta__title { font-size: 48px; }
}
@media (max-width: 900px) {
  .pr-grid { display: flex; flex-direction: column; }
  .pr-label { display: contents; }
  .pr-label__t { order: 0; margin-bottom: 24px; }
  .pr-label__t--sub { padding-top: 0; }
  .pr-body { order: 1; }
  .pr-meta { order: 2; margin-top: 48px; display: grid; grid-template-columns: auto 1fr; column-gap: 24px; }
  .pr-meta dt { margin-top: 12px; }
  .pr-meta dd { margin-top: 12px; max-width: none; }
  .pr-meta dt:first-of-type, .pr-meta dt:first-of-type + dd { margin-top: 0; }
  .pr-figures--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pr-step__text { position: static; margin-bottom: 32px; max-width: 560px; }
  .pr-step__num { margin-bottom: 20px; }
  .pr-h2 { text-wrap: wrap; }
  .pr-more__head { margin-bottom: 48px; }
  .pr-cta__body .pr-btn { margin-top: 40px; }
  .pr-results__row { margin-top: 48px; }
  .pr-results__text { order: 1; margin-top: 40px; }
}
@media (max-width: 767px) {
  :root { --band: 64px; }
  .pr-hero { padding-block: 69px 64px; }
  .pr-demo { width: 100vw; max-width: none; margin: 0 -20px; border-radius: 0; }
  .pr-stage { width: 100%; }
  .pr-hero__head { margin-top: 40px; }
  .pr-hero h1 { font-size: 36px; white-space: normal; }
  .pr-hero__lead { font-size: 19px; margin-top: 14px; }
  .pr-label__t { font-size: 14px; margin-bottom: 16px; }
  .pr-mark { width: 16px; height: 15px; margin-right: 10px; }
  .pr-h2 { font-size: 26px; margin-bottom: 20px; }
  .pr-text { font-size: 15px; }
  .pr-row { margin-top: 48px; }
  .pr-divided { margin-top: 64px; padding-top: 64px; }
  .pr-meta { font-size: 14px; }
  .pr-meta dt { font-size: 12px; }
  .pr-figures--3, .pr-figures--4 { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .pr-figure { display: grid; grid-template-columns: 128px minmax(0, 1fr); column-gap: 16px; align-items: end; align-content: end; padding: 16px 0; }
  .pr-figure__num { grid-row: 1 / span 2; font-size: 44px; margin: 0; }
  .pr-figure__label, .pr-figure__was { grid-column: 2; }
  .pr-figure__label { font-size: 14px; }
  .pr-figure__was { font-size: 12px; margin-top: 4px; }
  .pr-points { grid-template-columns: minmax(0, 1fr); row-gap: 32px; margin-top: 48px; }
  .pr-point { padding-top: 24px; }
  .pr-point h3, .pr-point h4 { margin: 16px 0 8px; }
  .pr-point p { font-size: 14px; }
  .pr-steps__label { font-size: 14px; margin: 64px 0 40px; padding-bottom: 16px; }
  .pr-steps__label:first-child { margin-top: 48px; }
  .pr-step { margin-bottom: 56px; }
  .pr-step__text { margin-bottom: 20px; }
  .pr-step__num { font-size: 44px; margin-bottom: 14px; }
  .pr-step h3 { font-size: 20px; margin-bottom: 10px; }
  .pr-step p { font-size: 14px; }
  .pr-step__shot { margin: 0 -20px; }
  .pr-step__shot img { border-radius: 0; }
  .pr-wave { margin: 8px 0 16px; }
  .pr-quote p { font-size: 24px; }
  .pr-quote__by { margin-top: 24px; }
  .pr-quote__by { font-size: 14px; }
  .pr-cta .pr-cta__title { font-size: 30px; }
  .pr-btn--big { height: 56px; padding: 0 24px; font-size: 16px; }
  .pr-cta__alt { margin-top: 20px; font-size: 18px; }
  .pr-comment .pr-wave { margin-bottom: 24px; }
  .pr-results { padding-bottom: 16px; }
  .pr-results__figs { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .pr-results__figs .pr-figure { padding: 16px 0; }
  .pr-results__figs .pr-figure__num { font-size: 44px; margin: 0; }
  .pr-results__figs .pr-figure__label { font-size: 14px; }
  .pr-results__figs .pr-figure__was { font-size: 12px; margin-top: 4px; }
  .pr-results__text { padding-top: 20px; margin-top: 24px; }
  .pr-btn { width: 100%; height: 52px; font-size: 16px; }
  .pr-cases {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-inline: -20px; padding: 0 20px 8px; scroll-padding-inline: 20px; scrollbar-width: none;
  }
  .pr-cases::-webkit-scrollbar { display: none; }
  .pr-case { flex: 0 0 84%; min-height: 320px; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hd-lines path { animation: none; stroke-dashoffset: 0; }
}
