/* Lareen inner pages: single project. Uses the theme tokens from lareen-globals.css. */
.kg-project {
  display: block;
  background: #fff;
  color: var(--text);
}
.kg-project h1,
.kg-project h2 {
  color: #211b2d;
  letter-spacing: -.02em;
}

/* Hero */
.kg-project-hero {
  padding-block: 28px 40px;
  background: linear-gradient(180deg, #f6f3fd 0%, #fff 100%);
}
.kg-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: .875rem;
  color: var(--muted);
}
.kg-crumbs a {
  color: var(--accent);
  font-weight: 700;
}
.kg-crumbs a:hover {
  text-decoration: underline;
}
.kg-crumbs [aria-current] {
  color: var(--text);
  font-weight: 700;
}
.kg-project-head {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.kg-project-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--purple-bg);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
}
.kg-project-intro h1 {
  margin-top: 12px;
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  font-weight: 900;
  line-height: 1.25;
}
.kg-project-lead {
  max-width: 62ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.8;
}
.kg-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.kg-project-tags li {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #45464c;
  font-size: .82rem;
  font-weight: 700;
}
.kg-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.kg-project-actions .btn {
  min-height: 48px;
}
.kg-project-facts {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(104, 61, 229, .14);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(36, 21, 76, .06);
}
.kg-project-facts div {
  padding-bottom: 10px;
  border-bottom: 1px solid #f0eff5;
}
.kg-project-facts div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.kg-project-facts dt {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}
.kg-project-facts dd {
  margin: 2px 0 0;
  font-weight: 800;
  line-height: 1.6;
}

/* Gallery */
.kg-project-gallery {
  padding-block: 8px 48px;
}
.kg-project-gallery .wrap {
  display: grid;
  gap: 28px;
}
.kg-browser {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(36, 21, 76, .1);
}
.kg-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #f7f6fb;
  direction: ltr;
}
.kg-browser-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dcd8e6;
}
.kg-browser-bar span {
  flex: 1;
  margin-inline-start: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.kg-browser-view {
  max-height: min(78vh, 860px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c9bdf3 transparent;
}
.kg-browser-view:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.kg-browser img {
  display: block;
  width: 100%;
  height: auto;
}

/* Story */
.kg-project-story {
  padding-block: 8px 56px;
}
.kg-project-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.kg-project-cols article {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #faf9fd;
}
.kg-project-cols h2 {
  font-size: 1.25rem;
  font-weight: 900;
}
.kg-project-cols p {
  margin-top: 10px;
  color: #45464c;
  line-height: 1.9;
}
.kg-project-content {
  max-width: 760px;
  margin-top: 32px;
  line-height: 1.9;
}
.kg-project-content > * + * {
  margin-top: 1em;
}
.kg-project-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* CTA */
.kg-project-cta {
  padding-block: 8px 56px;
}
.kg-project-cta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: 24px;
  background: var(--gradient);
  color: #fff;
}
.kg-project-cta-box h2 {
  color: #fff;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
}
.kg-project-cta-box p {
  margin-top: 6px;
  color: #ece6ff;
}
.kg-project-cta-box .kg-project-actions {
  margin-top: 0;
}

/* Related */
.kg-project-related {
  padding-block: 8px 80px;
}
.kg-related-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.kg-related-head h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 900;
}
.kg-related-head a {
  color: var(--accent);
  font-weight: 800;
}
.kg-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.kg-related-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
.kg-related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.kg-related-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.kg-related-card img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  height: auto;
  object-fit: cover;
  object-position: top;
  background: var(--purple-bg);
}
.kg-related-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
}
.kg-related-body small {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
}
.kg-related-body strong {
  font-size: 1.05rem;
  line-height: 1.5;
}
.kg-project-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}
.kg-project-pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: min(100%, 260px);
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: inherit;
}
.kg-project-pager a.is-next {
  margin-inline-start: auto;
  text-align: end;
}
.kg-project-pager a:hover {
  border-color: var(--primary);
}
.kg-project-pager small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

@media (max-width: 850px) {
  .kg-project-head {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .kg-project-hero {
    padding-block: 20px 28px;
  }
}
@media (max-width: 480px) {
  .kg-project-actions .btn {
    flex: 1 1 auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .kg-related-card {
    transition: none;
  }
}

/* App project page: phone screens in a row. */
.kg-phones {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 8px 4px 24px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #c9bdf3 transparent;
}
.kg-phones .kg-phone {
  flex: 0 0 clamp(200px, 26vw, 280px);
  overflow: hidden;
  border: 8px solid #1d1a24;
  border-radius: 34px;
  background: #1d1a24;
  box-shadow: 0 18px 40px rgba(36, 21, 76, .18);
  scroll-snap-align: center;
}
.kg-phones .kg-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
}
