:root {
  --ink: #0b0b0d;
  --muted: #5f6673;
  --line: #dfe3ea;
  --panel: rgba(255, 255, 255, 0.92);
  --soft: #f4f6f8;
  --chip: #eef1f5;
  --blue: #0a66c2;
  --green: #0f7a4f;
  --shadow: 0 24px 70px rgba(16, 24, 40, 0.12);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(218, 242, 235, 0.75), transparent 24rem),
    radial-gradient(circle at 92% 14%, rgba(232, 236, 240, 0.9), transparent 24rem),
    linear-gradient(180deg, #fff 0%, #f7f8f9 100%);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.page-shell {
  width: min(1280px, calc(100% - 64px));
  margin: 0 auto;
}

.portfolio-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  min-height: 128px;
  width: min(1280px, calc(100% - 64px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.portfolio-nav {
  display: flex;
  justify-content: flex-end;
  gap: 34px;
  height: 100%;
  align-items: center;
  margin-left: auto;
}

.portfolio-nav a {
  position: relative;
  font-weight: 800;
  color: #171d2d;
}

.portfolio-nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -47px;
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.social-link {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: transform 160ms ease, background 160ms ease;
}

.social-link:hover {
  background: #f0f2f5;
  transform: translateY(-1px);
}

.social-link svg {
  width: 24px;
  height: 24px;
  display: block;
}

.github-link svg { fill: #050505; }
.linkedin-link svg { fill: var(--blue); }

.wordmark-link img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.upwork-link img {
  border-radius: 7px;
}

.fiverr-link img {
  border-radius: 50%;
}

.portfolio-hero {
  padding: 72px 0 110px;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #172033;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 44px;
  height: 1px;
  background: #9aa3af;
}

h1 {
  margin: 0;
  font-size: clamp(48px, 5.8vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 900;
}

h1 span {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  margin-left: 14px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  background: #000;
  font-size: 16px;
  letter-spacing: 0;
  vertical-align: middle;
}

.hero-subtitle {
  max-width: 760px;
  margin: 26px 0 0;
  color: #536071;
  font-size: 20px;
  line-height: 1.45;
}

.library-panel {
  margin-top: 44px;
  max-width: 1060px;
}

.library-tools {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box {
  flex: 1;
  max-width: 720px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.06);
}

.search-box svg {
  width: 20px;
  height: 20px;
  fill: #667085;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-action {
  height: 56px;
  padding: 0 24px;
  border: 1px solid #000;
  border-radius: 18px;
  color: #fff;
  background: #000;
  font-weight: 900;
  cursor: pointer;
}

.topic-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 12px;
}

.topic-filter button {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: #121826;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.topic-filter button.active {
  color: #fff;
  border-color: #000;
  background: #000;
}

.library-status {
  min-height: 24px;
  margin: 0 0 18px;
  color: var(--muted);
}

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

.project-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

.project-card.featured {
  border-color: #98b7ff;
  box-shadow: 0 20px 60px rgba(18, 72, 180, 0.12);
}

.project-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 16px;
  align-items: start;
}

.project-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #eef4ff;
  color: #0d54d6;
  font-weight: 950;
}

.project-card:nth-child(3n+2) .project-icon {
  background: #eaf8ef;
  color: var(--green);
}

.project-card:nth-child(3n) .project-icon {
  background: #f3edff;
  color: #6840d8;
}

.project-industry {
  margin: 0 0 6px;
  color: #004c2f;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-card h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.project-card p {
  margin: 0;
  color: #425066;
  font-size: 15px;
  line-height: 1.48;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.project-tags span {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--chip);
  color: #111827;
  font-size: 12px;
  font-weight: 900;
}

.project-meta {
  color: #526173;
  font-size: 13px;
}

.project-link {
  width: fit-content;
  border: 0;
  padding: 0;
  color: #000;
  background: transparent;
  font-weight: 950;
  cursor: pointer;
}

.assistant-fab {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 80;
  min-width: 152px;
  height: 56px;
  padding: 0 22px;
  border: 1px solid #000;
  border-radius: 999px;
  color: #fff;
  background: #000;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  font-weight: 950;
  cursor: pointer;
}

.portfolio-assistant {
  position: fixed;
  right: 32px;
  bottom: 102px;
  z-index: 90;
  width: min(430px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid #202020;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.24);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 170ms ease, transform 170ms ease;
}

.portfolio-assistant.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.assistant-header {
  display: grid;
  grid-template-columns: 52px 1fr 32px;
  gap: 14px;
  align-items: center;
  padding: 18px 18px;
  color: #fff;
  background: #000;
}

.assistant-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #161b22;
  font-weight: 950;
}

.assistant-header strong {
  display: block;
  font-size: 16px;
}

.assistant-header span {
  display: block;
  margin-top: 3px;
  color: #cbd5e1;
  font-size: 13px;
}

.assistant-header button {
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.assistant-body {
  max-height: 410px;
  overflow: auto;
  padding: 18px;
  background: #fff;
}

.assistant-message {
  width: fit-content;
  max-width: 90%;
  margin-bottom: 12px;
  padding: 13px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.assistant-message.bot {
  background: #f0f2f5;
}

.assistant-message.user {
  margin-left: auto;
  color: #fff;
  background: #000;
}

.quick-questions {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.quick-questions button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #000;
  background: #f8fafc;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.assistant-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.assistant-input input {
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  outline: 0;
}

.assistant-input button {
  height: 48px;
  padding: 0 18px;
  border: 1px solid #000;
  border-radius: 14px;
  color: #fff;
  background: #000;
  font-weight: 950;
  cursor: pointer;
}

.portfolio-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  min-height: 90px;
  display: flex;
  align-items: center;
  gap: 24px;
  color: #536071;
}

.footer-inner a {
  color: #111827;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .page-shell {
    width: 100%;
    max-width: none;
    padding-right: 16px;
    padding-left: 16px;
  }
  .topbar-inner {
    width: 100%;
    max-width: none;
    padding: 16px;
  }
  .topbar-inner {
    min-height: 96px;
    column-gap: 12px;
    row-gap: 18px;
    flex-wrap: wrap;
  }
  .brand--portfolio {
    flex: 1 1 100%;
  }
  .portfolio-nav {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: 22px;
    margin-left: 0;
    order: 2;
  }
  .portfolio-nav a.active::after { bottom: -14px; width: 42px; }
  .top-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    margin-left: auto;
    order: 3;
  }
  .social-link { width: 32px; height: 32px; }
  .social-link svg { width: 21px; height: 21px; }
  .wordmark-link img {
    width: 24px;
    height: 24px;
  }
  .upwork-link img { border-radius: 6px; }
  .portfolio-hero {
    width: 100%;
    padding: 44px 0 84px;
  }
  .library-panel,
  .portfolio-hero {
    max-width: 100%;
  }
  .library-panel,
  .library-tools,
  .hero-copy,
  .hero-subtitle {
    width: min(100%, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }
  .hero-copy { max-width: 100%; }
  .eyebrow {
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    line-height: 1.4;
  }
  .eyebrow span {
    flex: 0 0 44px;
  }
  h1 {
    max-width: 100%;
    font-size: clamp(34px, 9.4vw, 40px);
    line-height: 1.04;
    letter-spacing: -0.035em;
  }
  h1 span {
    min-width: 28px;
    height: 28px;
    margin-left: 8px;
    font-size: 13px;
  }
  .hero-subtitle {
    max-width: 100%;
    font-size: 16px;
    overflow-wrap: break-word;
  }
  .library-tools { display: grid; }
  .search-box {
    width: min(100%, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }
  .search-action {
    width: min(100%, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }
  .project-grid { grid-template-columns: 1fr; }
  .footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 12px;
    padding: 22px 0 92px;
  }
  .assistant-fab {
    left: auto;
    right: 16px;
    bottom: 18px;
    width: fit-content;
    min-width: 152px;
    max-width: calc(100vw - 32px);
  }
  .portfolio-assistant { right: 16px; bottom: 86px; }
}
