:root {
  --bg: #071113;
  --grid: rgba(126, 203, 208, 0.12);
  --text: #eff5f3;
  --muted: rgba(239, 245, 243, 0.68);
  --line: rgba(160, 226, 230, 0.14);
  --line-strong: rgba(160, 226, 230, 0.24);
  --brand: #71c6cb;
  --brand-glow: rgba(113, 198, 203, 0.22);
  --panel: linear-gradient(180deg, rgba(12, 23, 25, 0.92), rgba(8, 17, 19, 0.94));
  --panel-soft: linear-gradient(180deg, rgba(14, 28, 30, 0.88), rgba(8, 17, 19, 0.92));
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 999px;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(43, 139, 147, 0.14), transparent 22%),
    linear-gradient(180deg, #071113 0%, #050d0f 100%);
}

body.lightbox-open {
  overflow: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--grid-size, 34px) var(--grid-size, 34px);
  mask-image: radial-gradient(circle at center, black 28%, transparent 82%);
}

.shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 14px;
  z-index: 40;
  padding-top: 18px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(9, 18, 20, 0.72);
  backdrop-filter: blur(18px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(113, 198, 203, 0.22);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at top center, rgba(113, 198, 203, 0.14), transparent 54%),
    rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    background 180ms ease;
}

.home-link:hover {
  transform: translateY(-2px);
  border-color: rgba(113, 198, 203, 0.4);
  color: var(--brand);
  box-shadow:
    0 0 24px rgba(113, 198, 203, 0.12),
    0 0 0 1px rgba(113, 198, 203, 0.06) inset;
}

.brand img,
.footer-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand span,
.footer-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand strong,
.footer-brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  transition: color 160ms ease, text-shadow 160ms ease;
}

.site-nav a:hover {
  color: var(--brand);
  text-shadow: 0 0 18px rgba(113, 198, 203, 0.2);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #2a8b93, #164f54);
  color: white !important;
}

.portfolio-hero {
  padding: 40px 0 24px;
}

.portfolio-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(320px, 0.62fr);
  gap: 24px;
  align-items: stretch;
}

.eyebrow,
.section-kicker,
.aside-label,
h1,
h2,
.portfolio-card-copy strong {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  letter-spacing: -0.05em;
}

.eyebrow,
.section-kicker,
.aside-label {
  color: var(--brand);
}

h1 {
  max-width: none;
  font-size: clamp(3.1rem, 5.2vw, 5rem);
  line-height: 0.94;
}

.portfolio-title {
  display: grid;
  gap: 4px;
  max-width: 15ch;
}

.portfolio-title span {
  display: block;
}

.title-accent {
  color: var(--brand);
}

h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1;
}

.portfolio-copy p,
.aside-card p,
.category-note,
.portfolio-card-copy span:last-child {
  color: var(--muted);
  line-height: 1.72;
}

.portfolio-copy p {
  max-width: 54ch;
  margin-top: 18px;
}

.aside-card,
.filter-chip,
.portfolio-card,
.category-note {
  border: 1px solid var(--line);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.aside-card,
.category-note {
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top left, rgba(113, 198, 203, 0.1), transparent 28%),
    var(--panel-soft);
  box-shadow: var(--shadow);
}

.portfolio-aside {
  display: flex;
}

.portfolio-aside .aside-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.aside-card:hover,
.category-note:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(113, 198, 203, 0.05) inset,
    0 0 26px rgba(113, 198, 203, 0.08);
}

.portfolio-filters {
  padding: 8px 0 20px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(11, 22, 24, 0.9), rgba(7, 15, 17, 0.92)),
    radial-gradient(circle at top left, rgba(113, 198, 203, 0.1), transparent 28%);
  box-shadow: var(--shadow);
}

.filter-chip {
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(239, 245, 243, 0.84);
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip.is-active {
  transform: translateY(-2px);
  border-color: rgba(113, 198, 203, 0.36);
  background:
    radial-gradient(circle at top center, rgba(113, 198, 203, 0.22), transparent 54%),
    linear-gradient(180deg, rgba(26, 71, 75, 0.82), rgba(13, 41, 44, 0.92));
  color: #eefbfb;
  box-shadow:
    0 0 24px rgba(113, 198, 203, 0.12),
    0 0 0 1px rgba(113, 198, 203, 0.06) inset;
}

.portfolio-sections {
  padding: 10px 0 72px;
}

.section-stack {
  display: grid;
  gap: 38px;
}

.portfolio-category {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(113, 198, 203, 0.24);
  border-radius: 32px;
  background:
    radial-gradient(circle at top left, rgba(113, 198, 203, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(9, 19, 21, 0.8), rgba(6, 13, 15, 0.84));
  box-shadow:
    0 0 0 1px rgba(113, 198, 203, 0.05) inset,
    0 18px 36px rgba(0, 0, 0, 0.18);
}

.portfolio-category::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 24px;
  border: 1px solid rgba(113, 198, 203, 0.12);
  pointer-events: none;
}

.portfolio-category.is-collapsed .portfolio-grid .portfolio-card:nth-child(n + 4) {
  display: none;
}

.category-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.6fr);
  gap: 18px;
  align-items: end;
}

.category-title {
  display: grid;
  gap: 10px;
}

.category-title h2 {
  max-width: 14ch;
}

#framework .category-title h2 {
  max-width: 18ch;
}

.category-note {
  min-height: 100%;
  position: relative;
  padding-left: 28px;
}

.category-note::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 12px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(113, 198, 203, 0.75), rgba(113, 198, 203, 0));
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.category-toggle {
  justify-self: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(113, 198, 203, 0.26);
  background:
    radial-gradient(circle at top center, rgba(113, 198, 203, 0.18), transparent 54%),
    linear-gradient(180deg, rgba(18, 46, 49, 0.92), rgba(10, 24, 26, 0.96));
  color: #dff6f7;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.category-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(113, 198, 203, 0.42);
  box-shadow:
    0 0 24px rgba(113, 198, 203, 0.12),
    0 0 0 1px rgba(113, 198, 203, 0.07) inset;
  color: var(--brand);
}

.portfolio-card {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portfolio-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(113, 198, 203, 0.05) inset,
    0 0 28px rgba(113, 198, 203, 0.08);
}

.portfolio-card-hit {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.portfolio-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  transition: transform 220ms ease, filter 220ms ease;
}

.portfolio-card:hover img {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.portfolio-card-copy {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.portfolio-card-copy strong {
  font-size: 1.22rem;
  line-height: 1.02;
}

.site-footer {
  padding: 20px 0 36px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(160, 226, 230, 0.14);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-brand p,
.back-link {
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--brand);
}

.lightbox {
  width: min(92vw, 1120px);
  height: min(90vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(113, 198, 203, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(10, 20, 22, 0.98), rgba(6, 13, 15, 0.98));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
}

.lightbox:not([open]) {
  display: none;
}

.lightbox::backdrop {
  background: rgba(2, 7, 9, 0.72);
  backdrop-filter: blur(8px);
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.lightbox-status,
.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lightbox-counter {
  color: var(--muted);
  font-weight: 700;
}

.lightbox-close-wrap {
  margin: 0;
}

.lightbox-close,
.lightbox-nav,
.lightbox-thumb {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.lightbox-nav:hover,
.lightbox-close:hover {
  border-color: rgba(113, 198, 203, 0.36);
  color: var(--brand);
  box-shadow: 0 0 22px rgba(113, 198, 203, 0.1);
}

.lightbox-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: stretch;
  min-height: 0;
}

.lightbox-media {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 0;
}

.lightbox-stage {
  min-height: 0;
  height: 100%;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(113, 198, 203, 0.05), transparent 24%),
    rgba(255, 255, 255, 0.02);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.lightbox-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-copy {
  display: grid;
  gap: 14px;
  min-height: 0;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(113, 198, 203, 0.09), transparent 32%),
    rgba(255, 255, 255, 0.03);
  align-content: start;
  color: var(--text);
  overflow: auto;
}

.lightbox-copy h2 {
  color: var(--text);
  font-size: clamp(1.8rem, 2.2vw, 2.5rem);
  line-height: 0.96;
}

.lightbox-copy .aside-label {
  margin-bottom: 0;
}

.lightbox-description {
  color: var(--muted);
  line-height: 1.72;
}

.lightbox-context {
  display: grid;
  gap: 8px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(113, 198, 203, 0.14);
}

.lightbox-detail {
  color: rgba(239, 245, 243, 0.84);
  line-height: 1.74;
}

.lightbox-meta {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(113, 198, 203, 0.14);
}

.lightbox-meta-title {
  color: rgba(239, 245, 243, 0.92);
  font-weight: 800;
}

.lightbox-meta-note {
  color: rgba(239, 245, 243, 0.78);
  line-height: 1.7;
}

.lightbox-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
}

.lightbox-thumb {
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.lightbox-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  max-height: none;
  border: 0;
  border-radius: 0;
  opacity: 0.7;
  transition: opacity 180ms ease, transform 180ms ease;
}

.lightbox-thumb:hover img,
.lightbox-thumb.is-active img {
  opacity: 1;
  transform: scale(1.04);
}

.lightbox-thumb.is-active {
  border-color: rgba(113, 198, 203, 0.4);
  box-shadow:
    0 0 0 1px rgba(113, 198, 203, 0.08) inset,
    0 0 24px rgba(113, 198, 203, 0.1);
}

@media (min-width: 1180px) and (max-height: 940px) {
  .site-header {
    top: 10px;
    padding-top: 12px;
  }

  .header-inner {
    padding: 12px 16px;
  }

  .home-link,
  .header-cta {
    min-height: 40px;
  }

  .portfolio-hero {
    padding: 24px 0 16px;
  }

  h1 {
    font-size: clamp(2.5rem, 4.1vw, 4.1rem);
  }

  .portfolio-copy p {
    font-size: 0.96rem;
    line-height: 1.62;
  }

  .filter-chip,
  .category-toggle {
    min-height: 42px;
  }

  .portfolio-sections {
    padding: 8px 0 56px;
  }

  .section-stack {
    gap: 30px;
  }

  .portfolio-category {
    gap: 16px;
    padding: 22px;
  }
}

@media (max-width: 1080px) {
  .portfolio-hero-layout,
  .category-head,
  .lightbox-body {
    grid-template-columns: 1fr;
  }

  .lightbox {
    height: auto;
    max-height: 90vh;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .header-inner,
  .site-nav,
  .footer-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    gap: 16px;
  }

  .header-left {
    width: 100%;
    justify-content: space-between;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .portfolio-title {
    max-width: 11ch;
  }

  .lightbox {
    width: min(94vw, 1120px);
    height: auto;
    padding: 14px;
  }

  .lightbox-topbar,
  .lightbox-actions {
    flex-wrap: wrap;
  }
}
