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

.portfolio-main { padding-top: 60px; }

/* Re-use page-header from about.css - same structure */
.page-header {
  padding: var(--sp-24) var(--sp-8) var(--sp-16);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  top: -200px; right: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.06;
  filter: blur(100px);
  pointer-events: none;
}
.page-header-inner { max-width: 1200px; margin: 0 auto; }
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 200;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: lowercase;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
}
.page-title em { font-style: normal; font-weight: 200; color: var(--gold-light); }
.page-subtitle { font-size: 1rem; color: var(--text-secondary); }

/* ── Jump Nav ── */
.jump-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 50;
}
.jump-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.jump-link {
  display: block;
  padding: var(--sp-4) var(--sp-6);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.jump-link:hover {
  color: var(--text-primary);
  border-color: var(--gold);
}

/* ── Section wrapper ── */
.port-section { padding: var(--sp-12) 0; }
.port-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-8);
}

.section-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: calc(-1 * var(--sp-4));
  margin-bottom: var(--sp-8);
}

/* ── Credentials Grid ── */
.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}

.cred-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--t-mid) var(--ease);
}
.cred-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.cred-img-slot {
  width: 100%;
  height: 160px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  margin-bottom: var(--sp-2);
}
.cred-img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cred-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold);
  text-align: center;
  line-height: 1.3;
  background: linear-gradient(135deg, var(--surface-3), var(--navy));
  letter-spacing: 0.05em;
}

.cred-title {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}
.cred-issuer {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}
.cred-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Project List ── */
.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.project-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  transition: all var(--t-mid) var(--ease);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--burgundy), var(--gold));
  opacity: 0;
  transition: opacity var(--t-mid);
}

.project-card:hover {
  border-color: var(--border-mid);
  transform: translateX(4px);
}
.project-card:hover::before { opacity: 1; }

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.project-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.project-links {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  border-bottom: 1px solid rgba(201,168,76,0.3);
  padding-bottom: 1px;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.project-link:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.placeholder-note {
  margin-top: var(--sp-6);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .port-inner { padding: 0 var(--sp-4); }
  .cred-grid { grid-template-columns: 1fr; }
  .project-card:hover { transform: none; }
  .project-card:hover::before { opacity: 1; }
}

/* ── Featured project card with video ── */
.project-card--featured {
  border-color: rgba(201,168,76,0.2);
}

.project-video-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  margin: var(--sp-2) 0;
}

.project-video-slot iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  pointer-events: none;
}

/* Transparent dark overlay to desaturate/dim the video */
.project-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 8, 0.55);
  mix-blend-mode: color;
  z-index: 1;
  pointer-events: none;
}

/* Applied skills list inside project card */
.project-applied-skills {
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-2);
}

.skills-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.skills-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-left: var(--sp-4);
  border-left: 2px solid var(--border);
}

.skills-list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Project detail list ── */
.project-detail-list {
  list-style: none;
  padding-left: var(--sp-4);
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.project-detail-list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
  padding-left: var(--sp-2);
}

/* ── Project video embed ── */
.project-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  margin-bottom: var(--sp-4);
  filter: grayscale(0.4);
}
.project-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

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

/* ── Split layout: text left, media right (~45%) ── */
.project-card--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: start;
}

/* Year right-justified in split card meta row */
.project-card--split .project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Year right-justified in split card meta row */
.project-card--split .project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  width: 100%;
}

.project-split-text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  /* Text column drives the row height; media column stretches to match */
}



.project-split-media {
  position: sticky;
  top: 120px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  aspect-ratio: 16/9;
}

.project-split-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-skills-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: calc(-1 * var(--sp-2));
}

@media (max-width: 768px) {
  .project-card--split {
    grid-template-columns: 1fr;
  }
  .project-split-media {
    position: static;
  }
}

/* ── Expandable credential images ── */
.cred-img-wrapper {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  /* Collapsed: fixed height, image centred */
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  transition: height 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.cred-img-wrapper.expanded {
  height: var(--expanded-h, 500px);
  align-items: flex-start;
}

.cred-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: height 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              object-fit 0s 0.55s;
}

.cred-img-wrapper.expanded img {
  height: auto;
  object-fit: contain;
  min-height: 100%;
}

/* Wine-red hover overlay with expand icon */
.cred-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(125, 29, 63, 0.0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-mid) var(--ease);
  pointer-events: none;
}

.cred-img-overlay::after {
  content: '⤢';
  font-size: 1.8rem;
  color: rgba(255,255,255,0);
  transition: color var(--t-mid) var(--ease);
  line-height: 1;
}

.cred-img-wrapper:hover .cred-img-overlay {
  background: rgba(125, 29, 63, 0.35);
}

.cred-img-wrapper:hover .cred-img-overlay::after {
  color: rgba(255, 255, 255, 0.9);
}

.cred-img-wrapper.expanded .cred-img-overlay {
  display: none;
}



/* ── Stacked media: screenshot above, video below - fills column height ── */
.project-split-media--stacked {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  height: 100%;
  min-height: 400px;
}

.project-split-screenshot {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  flex: 1;                      /* take equal share of height */
  min-height: 180px;
}

.project-split-screenshot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top left;    /* show top of dashboard first */
}

.project-split-video {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  flex: 1;                      /* take equal share of height */
  min-height: 160px;
  position: relative;
}

.project-split-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Project internship duration badge ── */
.project-duration-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.25);
  padding: 3px 10px;
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-2);
}

/* ── Project media marquee (vertical scroll, top to bottom) ── */
.project-marquee {
  overflow: hidden;
  border-radius: var(--r-md);
  width: 100%;
  height: 520px;
  /* Fade top and bottom edges */
  mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 6%, black 94%, transparent 100%);
}

.project-marquee-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  height: max-content;
  animation: projectMarqueeScroll 28s linear infinite;
}

.project-marquee-track:hover {
  animation-play-state: paused;
}

@keyframes projectMarqueeScroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.project-marquee-item {
  flex: 0 0 auto;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  position: relative;
}

.project-marquee-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-marquee-item--video {
  height: 200px;
}

.project-marquee-item--video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-marquee-item--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--surface-3), var(--navy));
  text-align: center;
  padding: var(--sp-4);
}

/* Split card right column: unset aspect-ratio so marquee controls height */
.project-split-media:has(.project-marquee) {
  aspect-ratio: unset;
  height: auto;
}


/* ── Vertical project marquee (scrolls top to bottom, seamless loop) ── */
/* Items are natural height. Set A and Set B are identical,
   so animating to -50% always lands exactly at the start of Set B,
   giving a perfect seamless loop regardless of item heights. */
.project-marquee--vertical {
  overflow: hidden;
  border-radius: var(--r-md);
  max-height: 560px;    /* cap height so it doesn't push cards too tall */
  mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
}

.project-marquee-track--vertical {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
  animation: projectMarqueeVertical 28s linear infinite;
}

.project-marquee-track--vertical:hover {
  animation-play-state: paused;
}

/* -50% works because track = Set A + Set B (equal halves) */
@keyframes projectMarqueeVertical {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.project-marquee--vertical .project-marquee-item {
  width: 100%;
  height: auto;           /* natural height - no cropping */
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-3);
}

.project-marquee--vertical .project-marquee-item img {
  width: 100%;
  height: auto;           /* full image visible */
  object-fit: contain;
  display: block;
  background: var(--surface-3);
}

.project-marquee--vertical .project-marquee-item--video {
  width: 100%;
  height: auto;
  position: relative;
  aspect-ratio: 16/9;     /* video at natural 16:9 proportion */
}

.project-marquee--vertical .project-marquee-item--video video {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* fill the video slot fully */
  display: block;
  background: #000;
}

/* Split media column - let height be driven by content */
.project-split-media:has(.project-marquee--vertical) {
  aspect-ratio: unset;
  min-height: unset;
  height: auto;
}
/* ── Tall media column: screenshot + video, equal halves ── */
.project-split-media--tall {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.project-media-screenshot {
  width: 100%;
  height: 220px;
  display: block;
  border-radius: var(--r-md);
  object-fit: cover;
  object-position: top left;
  background: var(--surface-3);
}

.project-media-video {
  width: 100%;
  height: 220px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  object-fit: cover;
  display: block;
}

/* ── AP1: 3 items × (180px + 3px gap) = 549px per set ── */
.project-marquee-track--ap1 {
  animation-name: projectMarqueeAP1;
  animation-duration: 18s;
}
@keyframes projectMarqueeAP1 {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-549px); }
}

/* AP1 carousel height = 2 items visible = 366px */
.project-marquee-track--ap1 ~ .project-marquee--vertical,
.project-card--split:has(.project-marquee-track--ap1) .project-marquee--vertical {
  height: 363px;
}

/* ── AP2: single video loops on its own, no marquee needed ── */
/* Just show the single video full-height, no animation needed */
.project-marquee-track--ap2 {
  animation: none;
}
.project-card--split:has(.project-marquee-track--ap2) .project-marquee--vertical {
  height: 363px;
  mask-image: none;
  -webkit-mask-image: none;
}
.project-marquee-track--ap2 .project-marquee-item--video {
  height: 363px;
}

/* ── Per-entry overrides ── */

/* AP6: 3 items, keep scrolling */
.project-marquee-track--ap6 { animation-duration: 20s; }

/* AP5, AP4, AP2: single video - static, no carousel needed */
.project-marquee-track--ap5,
.project-marquee-track--ap4,
.project-marquee-track--ap2 {
  animation: none;
}
.project-card--split:has(.project-marquee-track--ap5) .project-marquee--vertical,
.project-card--split:has(.project-marquee-track--ap4) .project-marquee--vertical,
.project-card--split:has(.project-marquee-track--ap2) .project-marquee--vertical {
  max-height: none;
  mask-image: none;
  -webkit-mask-image: none;
}

/* AP3: report + device mockups */
.project-marquee-track--ap3 { animation-duration: 22s; }

/* AP1: photo + 2 videos */
.project-marquee-track--ap1 { animation-duration: 24s; }

/* Devices slot inside marquee */
.project-marquee-item--devices {
  height: 260px;
  width: 100%;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2);
}

/* ── Device mockup frames ── */
.device-mockup-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--sp-4);
  width: 100%;
  height: 100%;
}

/* iPad frame */
.device-ipad {
  width: 170px;
  height: 230px;
  background: #1a1a1a;
  border-radius: 12px;
  border: 3px solid #333;
  box-shadow: 0 0 0 1px #444, inset 0 0 0 2px #222;
  padding: 8px 6px;
  position: relative;
  flex-shrink: 0;
}
.device-ipad::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  background: #333;
  border-radius: 2px;
}

/* iPhone frame */
.device-iphone {
  width: 100px;
  height: 210px;
  background: #1a1a1a;
  border-radius: 18px;
  border: 3px solid #333;
  box-shadow: 0 0 0 1px #444, inset 0 0 0 2px #222;
  padding: 14px 5px 10px;
  position: relative;
  flex-shrink: 0;
}
/* Dynamic island */
.device-iphone::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 6px;
  background: #000;
  border-radius: 3px;
}

/* Screen area fills remaining space */
.device-screen {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
}
.device-screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Static video-only split media (no carousel) ── */
.project-split-media--video-only {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  /* Let the video determine the height naturally */
}
.project-split-media--video-only video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Clean up the now-unused AP5/AP4/AP2 carousel overrides */
.project-card--split:has(.project-marquee-track--ap5) .project-marquee--vertical,
.project-card--split:has(.project-marquee-track--ap4) .project-marquee--vertical,
.project-card--split:has(.project-marquee-track--ap2) .project-marquee--vertical {
  display: none; /* these were replaced with static video-only in HTML */
}


/* ── Student Placements: screenshot + video stacked ── */
.project-placements-media {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: 100%;
  height: auto;              /* let children determine height */
  aspect-ratio: auto;        /* override the 16/9 from .project-split-media */
  overflow: visible;
}

.project-placements-screenshot {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  display: block;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--surface-3);
}

.project-placements-video {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  display: block;
  border-radius: var(--r-md);
  background: var(--surface-3);
  object-fit: cover;
}

/* ── KNIME project image: expandable, shows more by default ── */
.project-img-expandable {
  height: 240px;              /* taller default than credentials (160px) */
  border-radius: var(--r-md);
}
.project-img-expandable.expanded {
  height: var(--expanded-h, 600px);
}