.hub {
  --hub-header-height: 80px;
  color: var(--lettering);
}
.hub [hidden] { display: none; }

.hub-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0 15px;
  border-radius: 999px;
  font: 550 14px/1.2 system-ui, sans-serif;
  color: inherit;
  text-decoration: none;
}

.hub a:focus-visible {
  outline: 2px solid var(--lettering);
  outline-offset: 2px;
}

.hub-main {
  min-height: calc(100svh - var(--hub-header-height));
  padding: 20px clamp(16px, 5vw, 72px) 52px;
  box-sizing: border-box;
  touch-action: pan-y pinch-zoom;
}

.hub-content {
  position: relative;
  width: min(100%, 1050px);
  display: grid;
  justify-items: center;
  gap: clamp(22px, 5vh, 52px);
}

.hub-brand { text-align: center; }

.hub:not([data-section="home"]) .hub-main {
  align-items: start;
  padding-top: 0;
}

/* On section views the wordmark stays in the flow: it scrolls away with the
   page instead of hanging over the cards. */
.hub:not([data-section="home"]) .hub-brand {
  width: 100%;
  padding: 8px 0 12px;
}

.hub .wordmark {
  display: inline-block;
  font-size: clamp(1.7rem, 10.3vw, 8rem);
  transition: font-size .42s cubic-bezier(.2,.75,.25,1);
}

.hub:not([data-section="home"]) .wordmark { font-size: clamp(1.5rem, 5.4vw, 3.3rem); }

.hub-tagline {
  margin: 10px 0 0;
  font: 500 clamp(.68rem, 1.7vw, .92rem)/1.5 system-ui, sans-serif;
  letter-spacing: .055em;
  color: color-mix(in srgb, var(--lettering) 78%, var(--surface));
}

.hub-section { width: 100%; }
.hub-section h2 {
  width: fit-content;
  margin: 0 0 20px;
  font: 600 clamp(2rem, 5vw, 4.5rem)/1.08 "Bodoni Moda", Georgia, serif;
  letter-spacing: -.035em;
}
.hub-section h2:focus { outline: none; }
.hub-brief {
  max-width: 580px;
  min-height: 185px;
}
.hub-brief p { max-width: 48ch; font: 400 1rem/1.6 system-ui, sans-serif; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 26px);
}
.project-card {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 12px;
  padding: clamp(14px, 2.4vw, 22px);
  border: 1px solid color-mix(in srgb, var(--lettering) 21%, var(--surface));
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 94%, var(--lettering));
  font: 400 .92rem/1.55 system-ui, sans-serif;
  transition: border-color .24s, box-shadow .24s;
}
.project-card:is(:hover, :focus-within, [data-opening]) {
  border-color: var(--shimmer-edge);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--shimmer-edge) 17%, transparent);
}
.project-cover {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 100px;
  padding: 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--shimmer-edge) 28%, #fff);
  color: color-mix(in srgb, var(--shimmer-edge) 36%, #000);
}
.project-cover[data-palette="pni"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 10px;
  background: color-mix(in srgb, var(--shimmer-core) 15%, var(--surface));
  color: var(--lettering);
}
.project-cover > span {
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 7px;
  font-size: .75rem;
}

.pipeline-preview {
  position: relative;
  display: grid;
  grid-template: repeat(3, minmax(24px, auto)) / repeat(4, minmax(0, 1fr));
  gap: 7px;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--lettering) 16%, transparent) .6px, transparent .8px);
  background-size: 9px 9px;
}

.pipeline-preview .pipeline-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--shimmer-core);
}

.pipeline-preview .pipeline-edges path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.pipeline-preview .pipeline-edges :is(.pipeline-branch, .pipeline-signal) { stroke-dasharray: 3 3; }
.pipeline-preview .pipeline-edges .pipeline-signal { stroke: var(--shimmer-edge); stroke-width: 2; }

.pipeline-preview .pipeline-node {
  z-index: 1;
  grid-area: var(--row) / var(--column);
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 3px 2px;
  border: 1px solid color-mix(in srgb, var(--shimmer-core) 52%, var(--surface));
  border-radius: 6px;
  background: var(--surface);
  font: 650 .625rem/1.15 system-ui, sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
}

.pipeline-preview .pipeline-node[data-active] {
  border-color: var(--shimmer-edge);
  background: var(--shimmer-edge);
  color: #201b29;
}

@media (prefers-reduced-motion: no-preference) {
  .pipeline-preview .pipeline-node { transition: background-color 220ms ease, color 220ms ease; }
  .pipeline-preview[data-playing] .pipeline-signal { animation: pipeline-preview-signal 680ms linear infinite; }
}

@keyframes pipeline-preview-signal { to { stroke-dashoffset: -12; } }
.project-category { font-size: .75rem; letter-spacing: .045em; }
.project-card :is(h3, p) { margin: 0; }
.project-card h3 { font-size: clamp(1rem, 2vw, 1.26rem); line-height: 1.25; }
.project-result strong { display: block; font-size: 1.18rem; }
.project-metrics:has(.project-result + .project-result) {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.project-metrics:has(.project-result + .project-result) .project-result {
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--shimmer-edge) 13%, var(--surface));
  font-size: .78rem;
  line-height: 1.35;
}
.project-metrics:has(.project-result + .project-result) strong {
  margin-bottom: 4px;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.project-link { margin-top: auto; }
.project-card[href] { color: inherit; text-decoration: none; }
.project-card[href]:focus-visible { outline: 2px solid var(--lettering); outline-offset: 5px; }
.project-group-title { margin-block: 36px 18px; font: 600 clamp(1.4rem,3vw,2rem)/1.2 "Bodoni Moda",Georgia,serif; }
.project-card[data-project-id] .project-footnote { font-size: 14px; line-height: 1.5; }
.project-result sup {
  margin-inline-start: .16em;
  color: color-mix(in srgb, var(--shimmer-edge) 50%, var(--lettering));
  font-size: .55em;
  line-height: 0;
}
.project-card .project-footnote {
  max-width: 50ch;
  margin-top: -3px;
  color: color-mix(in srgb, var(--lettering) 76%, var(--surface));
  font-size: .74rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .project-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hub .wordmark, .hub-nav a, .project-card { transition: none; }
}

/* Creative на хабе: деморолики контент-завода прямо в разделе. */
.hub-lead {
  max-width: 62ch;
  margin: 0 0 18px;
  font-size: .97rem;
  line-height: 1.55;
  opacity: .78;
}

.hub-works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 18px;
}

.hub-work {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 86%, var(--lettering));
  box-shadow: 0 10px 30px rgb(0 0 0 / 7%);
}

.hub-work video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: #0d0d10;
}

.hub-work figcaption {
  padding: 10px 14px 12px;
  font-size: .8rem;
  line-height: 1.4;
}
.hub-work figcaption strong { display: block; font-size: .92rem; margin-bottom: 2px; }
.hub-work figcaption span { opacity: .68; }

@media (max-width: 620px) {
  .hub-works { grid-template-columns: 1fr; }
}
