:root {
  --li-blue: #0a66c2;
  --li-blue-dark: #004182;
  --li-blue-light: #e7f0fc;
  --li-bg: #f4f2ee;
  --li-text: rgba(0,0,0,0.9);
  --li-text-secondary: rgba(0,0,0,0.6);
  --li-border: rgba(0,0,0,0.15);
  --li-white: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--li-bg);
  color: var(--li-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

img { display: block; }

a { text-decoration: none; color: inherit; cursor: pointer; }

/* ---------- Page layout ---------- */
.page {
  max-width: 792px;
  margin: 24px auto;
  padding: 0 16px 48px;
}

.card, .profile-card {
  background: var(--li-white);
  border: 1px solid var(--li-border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  contain: content;
}

.card { padding: 20px 24px; }

.card-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
}

.card-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--li-text);
  white-space: pre-line;
}

/* ---------- Profile card ---------- */
.profile-banner {
  position: relative;
  width: 100%;
  height: 200px;
  background: var(--li-blue-light);
}

.bg-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-body {
  position: relative;
  padding: 0 24px 20px;
}

.profile-avatar {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  border: 4px solid var(--li-white);
  object-fit: cover;
  margin-top: -76px;
  background: var(--li-bg);
}

.profile-name {
  font-size: 24px;
  font-weight: 700;
  margin: 12px 0 4px;
}

.profile-headline {
  font-size: 16px;
  margin: 0 0 4px;
  color: var(--li-text);
}

.profile-location {
  font-size: 14px;
  color: var(--li-text-secondary);
  margin: 0 0 16px;
}
.profile-location a { color: var(--li-blue); font-weight: 600; }

.profile-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.btn {
  display: inline-block;
  border-radius: 24px;
  padding: 6px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--li-blue);
  color: var(--li-white);
}
.btn-primary:hover { background: var(--li-blue-dark); }

.profile-stats {
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--li-text-secondary);
}
.profile-stats a { color: var(--li-blue); }

/* ---------- Experience / Education ---------- */
.exp-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--li-border);
}
.exp-item:first-of-type { border-top: none; padding-top: 0; }

.exp-logo {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--li-bg);
}

.exp-main { flex: 1; min-width: 0; }

.exp-role { font-size: 16px; font-weight: 700; margin: 0; }
.exp-company, .exp-dates, .exp-location {
  font-size: 14px;
  color: var(--li-text-secondary);
  margin: 2px 0 0;
}
.exp-desc {
  font-size: 14px;
  color: var(--li-text);
  margin: 12px 0 0;
  line-height: 1.5;
}

/* ---------- Projects ---------- */
.project-item {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--li-border);
}
.project-item:first-of-type { border-top: none; padding-top: 0; }

.project-main { flex: 1; min-width: 0; }

.project-title { font-size: 16px; font-weight: 700; margin: 0; }
.project-desc {
  font-size: 14px;
  color: var(--li-text);
  margin: 8px 0 0;
  line-height: 1.5;
}

.project-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}
.project-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.project-tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--li-bg);
  border: 1px solid var(--li-border);
}
.project-tool-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--li-text-secondary);
}

/* ---------- Project photo slider ---------- */
.slider-wrap {
  margin-top: 12px;
}
.slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3264 / 2160;
  border-radius: 8px;
  overflow: hidden;
  background: var(--li-bg);
}
.slider-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  will-change: transform;
}
.slider-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
}
.slider-slide-clickable {
  cursor: zoom-in;
}
.slider-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.slider-dots .dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: #e2e0da;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: width 0.25s ease;
}
.slider-dots .dot.active { width: 28px; }
.slider-dots .dot-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: inherit;
  background: var(--li-blue);
}
.slider-dots .dot.active .dot-fill {
  animation-name: dot-fill;
  animation-duration: 3.5s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes dot-fill {
  from { width: 0%; }
  to { width: 100%; }
}

/* ---------- Skills ---------- */
.skills-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.skills-list li {
  font-size: 14px;
  font-weight: 600;
  padding: 10px 0;
  border-top: 1px solid var(--li-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.skills-list li:first-child { border-top: none; padding-top: 0; }
.skill-context {
  font-size: 13px;
  font-weight: 400;
  color: var(--li-text-secondary);
}

/* ---------- Toolbox ---------- */
.toolbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 20px 12px;
}
.toolbox-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.toolbox-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--li-bg);
  border: 1px solid var(--li-border);
}
.toolbox-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--li-text);
  line-height: 1.3;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  color: var(--li-text-secondary);
  font-size: 12px;
  margin-top: 24px;
}

@media (max-width: 640px) {
  .page {
    margin: 0;
    padding: 0 0 32px;
  }
  .card, .profile-card {
    border-left: none;
    border-right: none;
    border-radius: 0;
    margin-bottom: 8px;
  }
  .card { padding: 16px; }

  .profile-banner { height: 120px; }
  .profile-body { padding: 0 16px 16px; }
  .profile-avatar {
    width: 96px;
    height: 96px;
    margin-top: -48px;
    border-width: 3px;
  }
  .profile-name { font-size: 20px; }
  .profile-headline { font-size: 14px; }

  .profile-actions { flex-wrap: wrap; }
  .btn { font-size: 14px; padding: 6px 14px; }

  .profile-stats { flex-wrap: wrap; gap: 8px 16px; }

  .card-title { font-size: 18px; }

  .exp-item, .project-item { gap: 12px; }
  .exp-logo { width: 44px; height: 44px; }
  .exp-role, .project-title { font-size: 15px; }
}

@media (max-width: 420px) {
  .profile-avatar { width: 80px; height: 80px; margin-top: -40px; }
  .profile-actions .btn { width: 100%; text-align: center; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(21, 21, 21, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }

.lightbox-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
}
.lightbox-thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.5;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.lightbox-thumb:hover { opacity: 0.8; }
.lightbox-thumb.active {
  opacity: 1;
  border-color: var(--li-blue);
}

@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 20px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-thumb { width: 56px; height: 38px; }
}
