/* ---- заголовок внутренних страниц ---- */
.pagehead { padding: 64px 0 28px; }
.pagehead h1 { font-size: clamp(40px, 5.6vw, 64px); line-height: 1; animation: rise 0.7s var(--ease) backwards; }
.pagehead > .container > p { margin-top: 14px; color: var(--muted); font-size: 16px; max-width: 640px; animation: rise-soft 0.7s 0.1s var(--ease) backwards; }
.pagehead .toolbar, .pagehead .ptabs { animation: rise-soft 0.7s 0.18s var(--ease) backwards; }

.subhead { margin: 56px 0 18px; font-size: 28px; }

/* ---- проект ---- */
.pagehead--project { padding-top: 32px; padding-bottom: 0; background: var(--bg-raised); border-bottom: 2px solid var(--line); }
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; color: var(--muted); font-size: 13px; transition: color 0.15s; }
.crumb .icon { transition: transform 0.25s var(--bounce); }
.crumb:hover { color: var(--accent); }
.crumb:hover .icon { transform: translateX(-4px); }

.phead { display: flex; align-items: center; gap: 28px; }
.phead > .picon { animation: pop 0.6s var(--bounce) backwards; filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, 0.45)); }
@keyframes pop { from { opacity: 0; transform: scale(0.6) rotate(-10deg); } }
.phead__copy { flex: 1; min-width: 0; display: grid; gap: 10px; justify-items: start; }
.phead__copy h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1; animation: rise 0.7s 0.05s var(--ease) backwards; }
.phead__copy p { color: var(--muted); font-size: 16px; max-width: 640px; animation: rise-soft 0.6s 0.12s var(--ease) backwards; }
.phead__copy .chips { animation: rise-soft 0.6s 0.18s var(--ease) backwards; }
.phead__actions { display: flex; gap: 10px; flex-wrap: wrap; animation: rise-soft 0.6s 0.22s var(--ease) backwards; }

.tabs { display: flex; gap: 4px; margin-top: 30px; }
.tabs a { position: relative; padding: 12px 14px; color: var(--muted); font-size: 14px; font-weight: 600; transition: color 0.15s; }
.tabs a:hover { color: var(--text); }
.tabs a .mono { margin-left: 4px; color: var(--faint); font-size: 12px; }
.tabs a[aria-current="page"] { color: var(--text); }
.tabs a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -2px; height: 4px; background: var(--accent); transform: scaleX(0); transition: transform 0.3s var(--bounce); }
.tabs a[aria-current="page"]::after { transform: scaleX(1); }

.project { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; padding-top: 32px; }
.project__side { display: grid; gap: 16px; align-content: start; position: sticky; top: calc(var(--header-h) + 16px); }
.project__side > * { animation: rise-soft 0.6s var(--ease) backwards; }
.project__side > :nth-child(2) { animation-delay: 0.08s; }
.project__side > :nth-child(3) { animation-delay: 0.16s; }
.project__side > :nth-child(4) { animation-delay: 0.24s; }

.sidecard { --px-fill: var(--surface); padding: 20px; }
.sidecard--download { --px-line: rgba(242, 184, 75, 0.45); }
.sidecard h3 { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; font: 600 17px/1 var(--display); }
.sidecard h3 .mono { font: 400 12px/1 var(--mono); }
.sidecard .file { grid-template-columns: 1fr auto; padding: 10px 10px 10px 12px; }
.sidecard .file__icon { display: none; }
.sidecard .file__name b { font-size: 13px; }
.sidecard .file__name .mono { font-size: 11px; }
.sidecard .file .btn span { display: none; }
.sidecard .file .btn { width: 36px; padding: 0 0 3px; }

.facts { display: grid; gap: 10px; font-size: 13px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 2px dotted var(--line); }
.facts div:last-child { padding-bottom: 0; border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; }

.links { display: grid; gap: 2px; }
.links a { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; color: var(--muted); font-size: 14px; transition: background 0.15s, color 0.15s, padding 0.2s var(--ease); }
.links a:hover { background: var(--surface-hover); color: var(--text); padding-left: 12px; }

.people { display: grid; gap: 8px; }
.people a { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); transition: color 0.15s; }
.people a:hover { color: var(--accent); }
.people img { image-rendering: pixelated; transition: transform 0.3s var(--bounce); }
.people a:hover img { transform: rotate(-10deg) scale(1.1); }

.empty-card { --px-line: var(--line-strong); --px-fill: var(--bg-raised); padding: 32px; display: grid; gap: 10px; }

@media (max-width: 960px) {
  .project { grid-template-columns: 1fr; }
  .project__side { position: static; grid-row: 1; }
  .phead { flex-wrap: wrap; }
  .phead__actions { width: 100%; }
}

@media (max-width: 640px) {
  .phead { align-items: flex-start; gap: 16px; }
  .picon--lg { width: 68px; height: 68px; }
  .picon--lg.picon--letter { font-size: 36px; }
  .phead__actions .btn { flex: 1; }
}

/* ---- загрузки ---- */
.ptabs { display: flex; gap: 8px; margin-top: 30px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 6px; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab {
  --s: 2px;
  --px-fill: var(--bg-raised);
  height: 44px;
  padding: 0 16px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s, transform 0.2s var(--bounce), background 0.2s;
}
.ptab:hover { color: var(--text); --px-line: var(--line-strong); transform: translateY(-2px); }
.ptab[aria-current="page"] { color: var(--text); --px-line: var(--accent); --px-fill: #241c0e; }
.ptab[aria-current="page"] .picon { animation: hop 0.5s steps(5); }

.latest {
  --s: 4px;
  --bw: 3px;
  --px-line: rgba(242, 184, 75, 0.55);
  --px-fill: linear-gradient(120deg, #221b10 0%, var(--surface) 50%);
  padding: 30px;
  display: grid;
  gap: 22px;
  animation: rise-soft 0.6s 0.15s var(--ease) backwards;
}
.latest__head { display: flex; gap: 20px; align-items: center; }
.latest__head .picon--md { width: 72px; height: 72px; filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.45)); }
.latest__label { color: var(--accent); font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.latest__label::before { content: "▸ "; animation: blink 1.2s steps(1) infinite; }
.latest__head h2 { margin: 8px 0 6px; font: 600 34px/1 var(--display); }
.latest__head h2 a:hover { color: var(--accent); }
.latest__head .muted { font-size: 14px; }
.latest__versions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.latest .file { --px-fill: var(--bg); }
.latest .textlink { justify-self: start; margin-top: 0; }

@media (max-width: 640px) {
  .latest { padding: 20px; }
  .latest__head { align-items: flex-start; }
  .latest__head h2 { font-size: 26px; }
  .file { grid-template-columns: 1fr auto; }
  .file__icon { display: none; }
  .release__head .iconlink { margin-left: 0; }
}

/* ---- команда: большой 3D-скин на всю высоту карточки ---- */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
.member { --s: 4px; --bw: 3px; --px-fill: var(--surface); display: flex; gap: 28px; padding: 22px; min-height: 380px; }
.member:hover { --px-line: var(--line-strong); }
.member__skin {
  position: relative;
  width: 200px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 7% at 50% 90%, rgba(0, 0, 0, 0.6), transparent),
    repeating-conic-gradient(#1a1813 0 25%, #16140f 0 50%) 0 0 / 16px 16px;
  box-shadow: inset 0 0 0 2px var(--line);
}
/* плоский рендер, пока не загрузился 3D */
.member__flat { width: 46%; height: auto; image-rendering: pixelated; transition: opacity 0.3s; animation: bob 2.4s steps(6) infinite; }
.member__skin canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.5s; cursor: grab; touch-action: pan-y; }
.member__skin canvas:active { cursor: grabbing; }
.member__skin.is-3d canvas { opacity: 1; }
.member__skin.is-3d .member__flat { opacity: 0; }

.member__body { min-width: 0; display: grid; gap: 10px; align-content: start; padding-top: 6px; }
.member__title { display: flex; align-items: center; gap: 14px; }
.member__avatar { width: 48px; height: 48px; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg-raised), 0 0 0 5px var(--line-strong); transition: transform 0.4s var(--bounce); }
.member:hover .member__avatar { transform: rotate(-10deg) scale(1.06); }
.member__body h2 { font-size: 30px; line-height: 1; }
.member__title p { margin-top: 4px; font-size: 14px; }
.member__links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.member__links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; transition: color 0.15s; }
.member__links a:hover { color: var(--accent); }
.member__body h3 { margin-top: 14px; color: var(--faint); font: 600 14px/1 var(--display); }
.member__projects { display: flex; flex-wrap: wrap; gap: 6px; }
.member__projects a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 6px;
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 2px var(--line);
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s, box-shadow 0.15s, transform 0.2s var(--bounce);
}
.member__projects a:hover { color: var(--text); box-shadow: inset 0 0 0 2px var(--accent); transform: translateY(-2px); }

@media (max-width: 640px) {
  .team { grid-template-columns: 1fr; }
  .member { flex-direction: column; padding: 16px; gap: 18px; min-height: 0; }
  .member__skin { width: 100%; height: 300px; }
  .member__flat { width: auto; height: 80%; }
}

/* ---- 404: цифры прыгают по очереди ---- */
.notfound { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; }
.notfound__code { display: flex; gap: 4px; font-size: 128px; line-height: 1; color: var(--accent); text-shadow: 6px 6px 0 #4a3210; }
.notfound__code span { animation: hop 1.2s steps(6) infinite; }
.notfound__code span:nth-child(2) { animation-delay: 0.15s; }
.notfound__code span:nth-child(3) { animation-delay: 0.3s; }
.notfound h1 { font-size: 34px; }
.notfound .btn { margin-top: 12px; }
