/* ═════════════════════════════════════════
   PAGES: kwa kurasa za ndani
   (page hero, filters, project extras, flow, process)
   Inategemea base.css + layout.css + home.css
   ═════════════════════════════════════════ */

/* ───── entrance helper (sawa na ya hero.css) ───── */
.fade-up {
  animation: fade-up 1s var(--ease) var(--d, 0s) both;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ═════════ PAGE HERO (dark) ═════════ */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(140px, 22vh, 210px) var(--pad) clamp(110px, 14vw, 170px);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(
      40% 45% at 82% 28%,
      color-mix(in srgb, var(--accent) 14%, transparent),
      transparent 72%
    ),
    radial-gradient(
      45% 50% at 10% 100%,
      rgba(242, 239, 233, 0.05),
      transparent 70%
    );
  animation: page-drift 18s ease-in-out infinite alternate;
}
@keyframes page-drift {
  to {
    transform: translate3d(-3%, 2%, 0) scale(1.06);
  }
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.page-hero__title {
  margin-top: 22px;
  max-width: 17ch;
  font-family: var(--font-display);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-tracking);
  line-height: 0.98;
  font-size: clamp(34px, 7vw, 104px);
}
.page-hero__lede {
  margin-top: 28px;
  max-width: 52ch;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 19px);
}
.page-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* ═════════ FILTERS (ndani ya .work, background nyepesi) ═════════ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--ink-line);
  border-radius: 99px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color 0.3s,
    border-color 0.3s,
    color 0.3s;
}
.filters button:hover {
  border-color: var(--ink);
}
.filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #f2efe9;
}
.filters .count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.55;
}

/* ═════════ PROJECT EXTRAS ═════════ */
.project {
  scroll-margin-top: 110px;
}
.project[hidden] {
  display: none;
}
.project.is-shown {
  animation: pop-in 0.7s var(--ease) both;
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.project__goal {
  margin-top: 24px;
  padding-left: 16px;
  max-width: 46ch;
  border-left: 2px solid var(--ink);
  font-size: 14.5px;
  color: var(--ink-muted);
}
.project__goal b {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 14px 32px;
  margin-top: 26px;
}
@media (max-width: 480px) {
  .facts {
    grid-template-columns: repeat(2, max-content);
  }
}
.facts dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.facts dd {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 500;
}

/* ═════════ FLOW PANEL (hatua kwa hatua, dark) ═════════ */
.flow-panel {
  background: #0b0b0c;
  color: var(--fg);
  padding: clamp(22px, 5cqw, 36px);
}
.flow-panel__title {
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow {
  display: grid;
}
.flow__step {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 16px;
  padding-bottom: 24px;
}
.flow__step:last-child {
  padding-bottom: 0;
}
.flow__step::before {
  content: "";
  position: absolute;
  left: 13.5px;
  top: 30px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}
.flow__step:last-child::before {
  display: none;
}

.flow__node {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}
.flow__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow__name {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 500;
}
.flow__desc {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

/* hatua zinawaka moja baada ya nyingine (--s = namba ya hatua) */
.flow:not(.flow--static) .flow__node {
  animation: node-on 9s var(--ease) infinite both;
  animation-delay: calc(var(--s, 0) * 1.1s);
}
.flow:not(.flow--static) .flow__label {
  animation: label-on 9s var(--ease) infinite both;
  animation-delay: calc(var(--s, 0) * 1.1s);
}
@keyframes node-on {
  0%,
  6% {
    border-color: var(--line);
    background: transparent;
    color: var(--muted);
    box-shadow: none;
  }
  12%,
  88% {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  96%,
  100% {
    border-color: var(--line);
    background: transparent;
    color: var(--muted);
    box-shadow: none;
  }
}
@keyframes label-on {
  0%,
  6% {
    color: var(--muted);
  }
  12%,
  88% {
    color: var(--accent);
  }
  96%,
  100% {
    color: var(--muted);
  }
}

/* toleo lisilo na mwendo (mfano: orodha ya uwezo) */
.flow--static .flow__node {
  border-color: var(--accent);
  color: var(--accent);
}
.flow--static .flow__label {
  color: var(--accent);
}

/* ═════════ SHOP WIREFRAME (ndani ya .browser) ═════════ */
.shop {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.shop__cats {
  display: flex;
  gap: 8px;
}
.shop__cats i {
  width: 44px;
  height: 10px;
  border-radius: 99px;
  background: #dad5ca;
}
.shop__cats i:first-child {
  background: #0b0b0c;
}
.shop__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.shop__item {
  display: grid;
  gap: 6px;
}
.shop__item i {
  display: block;
  aspect-ratio: 4/3;
  border-radius: 8px;
  background: #efebe2;
  border: 1px solid rgba(11, 11, 12, 0.06);
}
.shop__item b {
  display: block;
  width: 72%;
  height: 6px;
  border-radius: 3px;
  background: #0b0b0c;
}
.shop__item span {
  display: block;
  width: 40%;
  height: 5px;
  border-radius: 3px;
  background: #dad5ca;
}
.shop__item:nth-child(2) i {
  background: var(--accent);
}

/* ═════════ FILE TREE (kwa "This portfolio") ═════════ */
.tree {
  background: #0b0b0c;
  color: var(--fg);
  padding: clamp(22px, 5cqw, 36px);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.95;
}
.tree__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tree__row.i1 {
  padding-left: 20px;
}
.tree__row.i2 {
  padding-left: 40px;
}
.tree .dir {
  color: var(--accent);
}
.tree .dim {
  color: var(--muted);
}

.js .tree__row {
  opacity: 0;
}
.js .is-in .tree__row {
  animation: row-in 0.6s var(--ease) calc(var(--n, 0) * 0.1s + 0.3s) both;
}
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ═════════ PROCESS (dark technical) ═════════ */
.process {
  position: relative;
  background: var(--bg);
}
.process::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(
    rgba(242, 239, 233, 0.09) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent,
    #000 22%,
    #000 78%,
    transparent
  );
  mask-image: linear-gradient(
    to bottom,
    transparent,
    #000 22%,
    #000 78%,
    transparent
  );
}
.process > * {
  position: relative;
}

.steps {
  display: grid;
  gap: 40px;
}
@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 40px;
  }
}
@media (min-width: 1100px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
  }
}

.step {
  position: relative;
  padding-top: 28px;
}
.step::before,
.step::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
}
.step::before {
  background: var(--line);
}
.step::after {
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.6s var(--ease) 0.3s;
}
.step.is-in::after {
  transform: scaleX(1);
}
.step__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.step h3 {
  margin-top: 14px;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.step p {
  margin-top: 10px;
  max-width: 34ch;
  color: var(--muted);
}
