/* ============================================
   PORTFOLIO PAGE STYLES
   ============================================ */

/* ---- Hero Profile ---- */
:root{
    /* Glass — white frosted glass */
  --glass:         rgba(255, 255, 255, .35);
  --glass-strong:  rgba(255, 255, 255, .5);
  --glass-border:  rgba(0, 0, 0, .18);
  --glass-inner:   rgba(255, 255, 255, .4);
  --glass-blur:    18px;
  --glass-blur-lg: 28px;

    /* Transitions */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

}
.portfolio-hero {
  padding: calc(var(--nav-h) + 48px) 0 40px;
}
.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, .08),
    0 1px 3px rgba(0, 0, 0, .06),
    inset 0 1px 0 rgba(255, 255, 255, .5);
  position: relative;
  overflow: hidden;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s;
}
.glass-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,.15) 30%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.15) 70%, transparent 95%);
  z-index: 1;
}

.portfolio-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}
.portfolio-avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(59, 130, 246, .3);
  box-shadow: 0 0 30px rgba(59, 130, 246, .15);
  flex-shrink: 0;
}
.portfolio-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.portfolio-name {
  font-family: var(--ff-serif);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.portfolio-role {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.portfolio-role-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.portfolio-reg {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.portfolio-quals {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.portfolio-training {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.portfolio-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-hover);
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ---- Portfolio Section ---- */
.portfolio-section {
  padding: 20px 0 80px;
}

/* ---- Grid ---- */
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  max-width: 560px;
  margin: 0 auto;
}

/* ---- Carousel Card (Instagram-style) ---- */
.carousel-card {
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
}
.carousel-card.glass-panel::before {
  display: none; /* remove the gradient line on these cards */
}

/* Header */
.carousel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}
.carousel-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(59, 130, 246, .2);
}
.carousel-author {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.carousel-date {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* Scoped to Experience Section */
#experience .services-grid {
  display: flex;
  flex-direction: column;  /* Stack each tile vertically */
  gap: 12px;
}

/* Tiles */
#experience .service-tile {
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  text-align: left;
  overflow: hidden;
}

/* Text inside tiles */
#experience .service-label {
  display: block;
  font-size: 14px;

  /* Desktop: single line with ellipsis */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Mobile Fix ---------- */
/* For small screens, allow wrapping but keep padding and clean layout */
@media (max-width: 600px) {
  #experience .service-label {
    white-space: normal;  /* allow text to wrap */
    overflow: visible;    /* remove cut-off */
    text-overflow: unset; /* remove ellipsis */
  }
}

/* Viewport */
.carousel-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
.carousel-slide {
  min-width: 100%;
  height: 100%;
}
.carousel-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* Arrows */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .85);
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  opacity: 0;
  transition: opacity .25s, transform .25s, background .2s;
  z-index: 2;
}
.carousel-viewport:hover .carousel-arrow {
  opacity: 1;
}
.carousel-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

/* Hide arrow if at boundary */
.carousel-arrow.hidden {
  opacity: 0 !important;
  pointer-events: none;
}

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
}
.carousel-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  transition: background .25s, transform .25s;
  padding: 0;
}
.carousel-dot.active {
  background: var(--accent-hover);
  transform: scale(1.3);
}

/* Caption */
.carousel-caption {
  padding: 4px 16px 16px;
}
.carousel-caption p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}
.carousel-caption strong {
  color: var(--text);
}

/* ---- Responsive ---- */
@media (min-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }
  .portfolio-hero-inner {
    flex-direction: row;
    text-align: left;
    gap: 32px;
  }
  .portfolio-stats {
    justify-content: flex-start;
  }
}

/* Mobile touch — always show arrows on small screens */
@media (max-width: 767px) {
  .carousel-arrow {
    opacity: .7;
    width: 28px; height: 28px;
  }
  .carousel-prev { left: 6px; }
  .carousel-next { right: 6px; }
  .portfolio-stats { gap: 20px; }
}

.page-section {
  position: relative; padding: 90px 0;
  overflow: hidden;
}
.page-section:first-of-type {
  padding-top: calc(var(--nav-h) + 40px);
  /* Add per-section bg image via inline style:
     background: url('...') center/cover no-repeat; */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Light overlay on section bg images for readability */
.page-section::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: rgba(255, 255, 255, .4);
  pointer-events: none;
}

/* Mobile menu for portfolio page */
@media (max-width: 767px) {
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: linear-gradient(135deg, #ffffff, #e6f0ff);
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    flex-direction: column;
    padding: 14px 28px 22px; gap: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    box-shadow: 0 12px 40px rgba(0,0,0,.1);
    transform: translateY(-12px);
    opacity: 0; visibility: hidden;
    transition: transform .35s cubic-bezier(.16, 1, .3, 1), opacity .35s, visibility .35s;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1; visibility: visible;
  }
  .mobile-toggle { display: flex; }
}
