/* VibeLab Portfolio — Signature Theme v3 (Read.cv editorial)
   ---------------------------------------------------------------
   Single-scroll narrow column. Quiet typography. Generous rhythm.
   Light is the default; .color-dark opts into dark surface.
*/

/* ─── Theme tokens ───────────────────────────────────────────── */

body.theme-signature {
  --font-display: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif:   'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-mono:    'IBM Plex Mono', 'IBM Plex Sans', ui-monospace, SFMono-Regular, Menlo, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 128px;
  --space-9: 160px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Light surface palette (default) */
  --surface-0: #ffffff;
  --surface-1: #fafaf8;        /* off-white card bg */
  --surface-2: #f0f0ed;
  --border:    #e8e8e3;
  --border-strong: #cfcfc9;
  --text-1:    #0a0a0a;        /* headings */
  --text-2:    #3a3a3a;        /* body */
  --text-3:    #707070;        /* muted */
  --text-4:    #9a9a9a;        /* very muted */

  /* Accent (set inline per profile) */
  --portfolio-accent: #c8ff00;
  --portfolio-accent-contrast: #0a0a0a;
  --portfolio-accent-tint: rgba(200, 255, 0, 0.12);
  --portfolio-accent-readable: color-mix(in srgb, var(--portfolio-accent), #000 45%);

  background: var(--surface-0);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.theme-signature.color-dark {
  --surface-0: #0a0a0a;
  --surface-1: #141414;
  --surface-2: #1f1f1f;
  --border:    #2a2a2a;
  --border-strong: #3a3a3a;
  --text-1:    #f5f5f5;
  --text-2:    #cfcfcf;
  --text-3:    #888;
  --text-4:    #666;
  --portfolio-accent-readable: var(--portfolio-accent);
}

/* ─── Page layout: narrow centered column ──────────────────── */

.portfolio {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-7);
}

.portfolio > section,
.portfolio > article {
  margin-top: var(--space-7);
}

/* ─── Owner toolbar (Edit + Customize) ─────────────────────── */

.portfolio-owner-toolbar {
  position: fixed;
  top: 80px;
  right: var(--space-4);
  z-index: 50;
  display: none;
  align-items: center;
  gap: 8px;
}

.portfolio-owner-toolbar.show { display: inline-flex; }

.portfolio-owner-btn {
  padding: 8px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-1);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: border-color 120ms ease, transform 120ms ease;
}

.portfolio-owner-btn:hover {
  border-color: var(--text-1);
  transform: translateY(-1px);
}

.portfolio-owner-btn.primary {
  background: var(--portfolio-accent);
  color: var(--portfolio-accent-contrast);
  border-color: var(--portfolio-accent);
}

.portfolio-owner-btn .gear {
  display: inline-block;
  width: 14px;
  height: 14px;
}

/* ─── Hero ────────────────────────────────────────────────── */

.portfolio-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
}

.portfolio-hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border);
  flex-shrink: 0;
  margin-bottom: var(--space-2);
}

.portfolio-hero-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

.portfolio-hero-avatar-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 36px; font-weight: 700;
  color: var(--portfolio-accent-readable);
  background: var(--portfolio-accent-tint);
}

.portfolio-hero-name {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.2vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-1);
  margin: 0;
}

/* URL chip — small monochrome, click to copy */
.portfolio-url-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.portfolio-url-chip:hover {
  border-color: var(--text-2);
  color: var(--text-1);
}

.portfolio-url-chip .url-host { color: var(--text-4); }
.portfolio-url-chip .url-handle { color: var(--text-2); font-weight: 500; }
.portfolio-url-chip .url-copy-icon { opacity: 0.5; font-size: 10px; }
.portfolio-url-chip.copied { border-color: var(--portfolio-accent-readable); color: var(--portfolio-accent-readable); }
.portfolio-url-chip.copied .url-copy-icon::before { content: '✓ '; opacity: 1; }

/* Role line (one line, optional accent word) */
.portfolio-hero-role {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-2);
  margin: var(--space-3) 0 0;
  max-width: 640px;
}

.portfolio-hero-role .accent { color: var(--portfolio-accent-readable); font-weight: 600; }

/* Bio — 2-3 line paragraph */
.portfolio-hero-bio {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-2);
  margin: var(--space-2) 0 0;
  max-width: 640px;
}

.portfolio-hero-bio p { margin: 0 0 var(--space-2); }
.portfolio-hero-bio p:last-child { margin-bottom: 0; }

/* Contact row — quiet typographic links separated by middle dot */
.portfolio-contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.portfolio-contact-link {
  color: var(--text-3);
  text-decoration: none;
  font-size: 14px;
  position: relative;
  padding-right: var(--space-3);
  transition: color 120ms ease;
}

.portfolio-contact-link:not(:last-child)::after {
  content: '·';
  color: var(--text-4);
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
}

.portfolio-contact-link:hover {
  color: var(--portfolio-accent-readable);
}

/* Output-signal stat line (kept small + muted; opt-in) */
.portfolio-stat-line {
  margin-top: var(--space-3);
  font-size: 13px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}

.portfolio-stat-line strong {
  color: var(--text-3);
  font-weight: 600;
}

/* ─── Section headings ────────────────────────────────────── */

.portfolio-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
}

.portfolio-section-heading {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0;
}

.portfolio-section-action {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.portfolio-section-action:hover { color: var(--portfolio-accent-readable); }

/* ─── Empty section (owner-only "+ Add" affordance) ──────── */

.portfolio-empty {
  padding: var(--space-4) var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.portfolio-empty:hover {
  border-color: var(--portfolio-accent-readable);
  color: var(--portfolio-accent-readable);
}

/* ─── Vibes ────────────────────────────────────────────────── */

.portfolio-vibes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (max-width: 600px) {
  .portfolio-vibes-grid { grid-template-columns: 1fr; }
}

.portfolio-vibe-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.portfolio-vibe-thumb {
  aspect-ratio: 4 / 3;
  background-color: var(--surface-1);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 200ms ease;
}

.portfolio-vibe-card:hover .portfolio-vibe-thumb {
  transform: translateY(-2px);
}

.portfolio-vibe-info {
  margin-top: var(--space-2);
}

.portfolio-vibe-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
  line-height: 1.35;
}

.portfolio-vibe-meta {
  font-size: 13px;
  color: var(--text-3);
  margin: 2px 0 0;
}

/* ─── Case studies ─────────────────────────────────────────── */

.portfolio-case-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.portfolio-case-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Pastel rotation per case study card */
.portfolio-case-card:nth-child(5n+1) .portfolio-case-image { background-color: #cfdeea; }
.portfolio-case-card:nth-child(5n+2) .portfolio-case-image { background-color: #e7d8f5; }
.portfolio-case-card:nth-child(5n+3) .portfolio-case-image { background-color: #f3e2c2; }
.portfolio-case-card:nth-child(5n+4) .portfolio-case-image { background-color: #d4e5d4; }
.portfolio-case-card:nth-child(5n+5) .portfolio-case-image { background-color: #f6dde0; }

.portfolio-case-image {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  box-sizing: border-box;
  overflow: hidden;
  margin-bottom: var(--space-3);
  transition: transform 200ms ease;
}

.portfolio-case-card:hover .portfolio-case-image { transform: translateY(-2px); }

.portfolio-case-image-placeholder {
  font-family: var(--font-display);
  font-size: 12px;
  color: rgba(10, 10, 10, 0.4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portfolio-case-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 4px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.portfolio-case-excerpt {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
  max-width: 560px;
}

.portfolio-icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.portfolio-icon-btn:hover { border-color: var(--text-1); color: var(--text-1); }

/* ─── Skills ─────────────────────────────────────────────── */

.portfolio-skills-row {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 640px;
}

.portfolio-skills-row .sep {
  color: var(--text-4);
  margin: 0 8px;
}

.portfolio-skills-row .skill {
  color: var(--text-1);
}

/* Achievements (optional, structured) — its own reorderable section */
.portfolio-achievement-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.portfolio-achievement {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: var(--space-3);
  font-size: 14px;
}

.portfolio-achievement-year {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.portfolio-achievement-title { color: var(--text-2); }

.portfolio-achievement-title a {
  color: var(--portfolio-accent-readable);
  text-decoration: none;
}

/* ─── Resume ─────────────────────────────────────────────── */

.portfolio-resume {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.portfolio-resume-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--portfolio-accent-tint);
  color: var(--portfolio-accent-readable);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.portfolio-resume-info { flex: 1; min-width: 0; }

.portfolio-resume-title { font-size: 14px; font-weight: 600; color: var(--text-1); margin: 0; }
.portfolio-resume-meta  { font-size: 12px; color: var(--text-3); margin: 2px 0 0; }

.portfolio-resume-download {
  padding: 8px 16px;
  background: var(--text-1);
  color: var(--surface-0);
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.portfolio-resume-download:hover { background: var(--portfolio-accent-readable); }

/* ─── Footer ─────────────────────────────────────────────── */

.portfolio-footer {
  margin-top: var(--space-6);
  /* override the generic `footer { border-top; padding }` from styles.css —
     no divider, no extra padding; sits 12px above the global site footer */
  border-top: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-3);
}

.portfolio-footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  font-size: 12px;
  color: var(--text-4);
}

.portfolio-footer-meta a {
  color: var(--text-4);
  text-decoration: none;
  border-bottom: 1px dashed var(--border-strong);
}

.portfolio-footer-meta a:hover { color: var(--text-2); }

/* ─── Edit modal ─────────────────────────────────────────── */

.portfolio-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.5);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-5) var(--space-3);
  overflow-y: auto;
}

.portfolio-modal-backdrop.open { display: flex; }

.portfolio-modal {
  background: var(--surface-0);
  color: var(--text-1);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--space-7));
  overflow: hidden;
}

/* When body is dark mode, modal stays light (always-light edit context for clarity) */

.portfolio-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.portfolio-modal-head h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--text-1);
}

.portfolio-modal-close {
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-modal-close:hover {
  background: var(--surface-1);
  color: var(--text-1);
}

.portfolio-modal-tabs {
  display: flex;
  gap: 2px;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.portfolio-modal-tab {
  padding: var(--space-3) var(--space-3);
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.portfolio-modal-tab.active {
  color: var(--text-1);
  border-bottom-color: var(--portfolio-accent-readable);
}

.portfolio-modal-tab:hover:not(.active) { color: var(--text-2); }

.portfolio-modal-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  overflow-y: auto;
  flex: 1;
}

.portfolio-modal-body label {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  margin-top: var(--space-3);
  font-weight: 500;
}

.portfolio-modal-body label:first-of-type { margin-top: 0; }

.portfolio-modal-body input[type="text"],
.portfolio-modal-body input[type="email"],
.portfolio-modal-body input[type="url"],
.portfolio-modal-body textarea,
.portfolio-modal-body select {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color 120ms ease;
}

.portfolio-modal-body input:focus,
.portfolio-modal-body textarea:focus,
.portfolio-modal-body select:focus {
  outline: none;
  border-color: var(--portfolio-accent-readable);
}

.portfolio-modal-body textarea { resize: vertical; min-height: 80px; }

.portfolio-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--surface-1);
}

.portfolio-modal-btn {
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.portfolio-modal-btn-primary {
  background: var(--portfolio-accent);
  color: var(--portfolio-accent-contrast);
}

.portfolio-modal-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.portfolio-modal-btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.portfolio-modal-btn-ghost:hover { background: var(--surface-1); }

.portfolio-modal-btn-danger {
  background: transparent;
  color: #ff6b5b;
  margin-right: auto;
}

.portfolio-modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 500px) {
  .portfolio-modal-grid-2 { grid-template-columns: 1fr; }
}

/* Customize tab — accent presets + color mode */

.portfolio-accent-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.portfolio-accent-swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 100ms ease, border-color 100ms ease;
}

.portfolio-accent-swatch.selected {
  border-color: var(--text-1);
  transform: scale(1.1);
}

.portfolio-color-mode-row {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-3);
}

.portfolio-color-mode-btn {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.portfolio-color-mode-btn.active {
  background: var(--portfolio-accent);
  color: var(--portfolio-accent-contrast);
  border-color: var(--portfolio-accent);
}

.portfolio-privacy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--space-3);
  font-size: 13px;
  color: var(--text-2);
}

.portfolio-accent-contrast-badge {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-3);
}

.portfolio-accent-contrast-badge.aa { color: #2c8e57; }
.portfolio-accent-contrast-badge.warn { color: #c46d20; }
.portfolio-accent-contrast-badge.fail { color: #c0392b; }

/* Socials grid in modal */
.portfolio-socials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 500px) {
  .portfolio-socials-grid { grid-template-columns: 1fr; }
}

/* Inline status indicator (saving / saved / error) */
.portfolio-modal-status {
  font-size: 12px;
  color: var(--text-3);
  margin-right: auto;
  align-self: center;
}

.portfolio-modal-status.saving { color: var(--text-2); }
.portfolio-modal-status.saved { color: #2c8e57; }
.portfolio-modal-status.error { color: #c0392b; }

/* ─── Mobile edit-block banner ─────────────────────────────── */

.portfolio-mobile-edit-block {
  position: fixed;
  inset: 0;
  background: var(--surface-0);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  text-align: center;
}

.portfolio-mobile-edit-block h2 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-1);
  margin: 0 0 var(--space-2);
}

.portfolio-mobile-edit-block p {
  color: var(--text-2);
  max-width: 360px;
  margin: 0 0 var(--space-4);
}

.portfolio-mobile-edit-block .btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--portfolio-accent);
  color: var(--portfolio-accent-contrast);
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
}

/* ─── Reduced motion ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ─── Mobile ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .portfolio { padding: var(--space-5) var(--space-3) var(--space-6); }
  .portfolio > section, .portfolio > article { margin-top: var(--space-6); }
  .portfolio-hero-name { font-size: 38px; }
  .portfolio-owner-toolbar { top: 68px; right: var(--space-3); }
  .portfolio-owner-btn { padding: 6px 12px; font-size: 12px; }
}

/* Hide legacy elements from v2 (kept for compat with cached HTML) */
.portfolio-edit-pill,
.portfolio-done-pill,
.portfolio-theme-fab,
.portfolio-save-status,
.portfolio-accent-panel,
.portfolio-prefs-icon,
.portfolio-hero-top,
.portfolio-section-handle,
.portfolio-case-layout-toggle {
  display: none !important;
}

/* ════════════════════════════════════════════════════════════════
   DENSE BASELINE elements (stats, company, skills pills, social
   buttons, activity heatmap) + Layout-tab UI. Added 2026-06-14.
   ════════════════════════════════════════════════════════════════ */

/* Company line under the name */
.portfolio-hero-company {
  font-size: 15px;
  color: var(--text-2);
  font-weight: 500;
  margin: var(--space-2) 0 0;
}

/* Stats row */
.portfolio-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.portfolio-stat {
  font-size: 14px;
  color: var(--text-3);
}

.portfolio-stat strong {
  color: var(--text-1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Skills in hero */
.portfolio-hero-skills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.portfolio-skills-label {
  font-size: 14px;
  color: var(--text-3);
  margin-right: 2px;
}

.portfolio-skills-text { font-size: 14px; color: var(--text-2); }

.portfolio-skill-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: var(--portfolio-accent-tint);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--portfolio-accent-readable);
  font-weight: 500;
}

/* Social row — buttons variant */
.portfolio-socials-row.as-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.portfolio-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 120ms ease, color 120ms ease;
}

.portfolio-social-btn:hover {
  border-color: var(--portfolio-accent-readable);
  color: var(--portfolio-accent-readable);
}

/* Social row — text variant (reuses .portfolio-contact-link) */
.portfolio-socials-row.as-text {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* Hosted badge on vibe thumbs */
.portfolio-vibe-thumb { position: relative; }
.portfolio-vibe-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  background: rgba(10, 10, 10, 0.85);
  color: #c8ff00;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

/* ── Activity heatmap (Challenge Activity) ── */
.streak-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.streak-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.streak-day-label {
  width: 28px;
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
  text-align: right;
  padding-right: 4px;
}

.streak-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--surface-2);
}

.streak-level-empty { background: transparent; }
.streak-level-0 { background: var(--surface-2); }
.streak-level-1 { background: color-mix(in srgb, var(--portfolio-accent), var(--surface-0) 60%); }
.streak-level-2 { background: color-mix(in srgb, var(--portfolio-accent), var(--surface-0) 30%); }
.streak-level-3 { background: var(--portfolio-accent); }

.streak-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-3);
  font-size: 11px;
  color: var(--text-3);
  justify-content: flex-end;
}

.streak-legend .streak-cell { width: 11px; height: 11px; }

/* ── Layout tab UI (in the edit modal) ── */
.pem-layout-section {
  margin-bottom: var(--space-4);
}

.pem-layout-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pem-layout-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pem-layout-row.dragging { opacity: 0.5; }

.pem-layout-handle {
  cursor: grab;
  color: var(--text-3);
  font-size: 14px;
  user-select: none;
}

.pem-layout-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-1);
}

.pem-layout-move {
  display: flex;
  gap: 2px;
}

.pem-layout-move button {
  width: 24px; height: 24px;
  border: 1px solid var(--border);
  background: var(--surface-0);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}

.pem-layout-move button:hover:not(:disabled) { border-color: var(--text-1); color: var(--text-1); }
.pem-layout-move button:disabled { opacity: 0.3; cursor: not-allowed; }

.pem-layout-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.pem-layout-toggle input { opacity: 0; width: 0; height: 0; }

.pem-layout-toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  transition: background 160ms ease;
  cursor: pointer;
}

.pem-layout-toggle .slider::before {
  content: '';
  position: absolute;
  height: 16px; width: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 160ms ease;
}

.pem-layout-toggle input:checked + .slider { background: var(--portfolio-accent); }
.pem-layout-toggle input:checked + .slider::before { transform: translateX(16px); }

.pem-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.pem-display-row:first-child { border-top: 0; }

.pem-display-label { font-size: 14px; color: var(--text-1); }
.pem-display-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.pem-segmented {
  display: inline-flex;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 2px;
}

.pem-segmented button {
  padding: 5px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
}

.pem-segmented button.active {
  background: var(--portfolio-accent);
  color: var(--portfolio-accent-contrast);
}

.pem-layout-subhead {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: var(--space-4) 0 var(--space-2);
  font-weight: 600;
}

.pem-layout-subhead:first-child { margin-top: 0; }

/* Inline owner actions next to the hero name (replaces fixed toolbar) */
.portfolio-hero-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.portfolio-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.portfolio-hero-actions[hidden] { display: none; }

/* ════════════════════════════════════════════════════════════════
   v4 — center-aligned hero, bigger bio, 3-col vibes, icon pills.
   Appended last so these win over earlier left-aligned rules.
   ════════════════════════════════════════════════════════════════ */

/* Center the hero stack */
.portfolio-hero-name-row { justify-content: center; }
.portfolio-url-chip { align-self: center; }
.portfolio-hero-company { text-align: center; }
.portfolio-hero-role { margin-left: auto; margin-right: auto; text-align: center; }
.portfolio-hero-bio  { margin-left: auto; margin-right: auto; text-align: center; }
.portfolio-stats-row,
.portfolio-hero-skills,
.portfolio-socials-row.as-buttons,
.portfolio-socials-row.as-text { justify-content: center; }

/* Bigger, bolder About/bio (~35% larger) */
.portfolio-hero-bio {
  font-size: 23px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text-1);
  max-width: 680px;
}

/* Center section headings */
.portfolio-section-head { justify-content: center; text-align: center; }

/* Vibes — 3 columns */
.portfolio-vibes-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .portfolio-vibes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .portfolio-vibes-grid { grid-template-columns: 1fr; } }

/* ── Icon social pills (better looking) ── */
.portfolio-socials-row.as-buttons {
  gap: 10px;
  margin-top: var(--space-4);
}

.portfolio-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px 9px 14px;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: border-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.portfolio-social-btn .social-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-3);
  transition: color 140ms ease;
}

.portfolio-social-btn:hover {
  border-color: var(--text-1);
  color: var(--text-1);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.portfolio-social-btn:hover .social-icon { color: var(--text-1); }

/* Per-brand hover tints (icon + border) */
.portfolio-social-btn[data-platform="twitter"]:hover  { border-color: #1d9bf0; color: #1d9bf0; }
.portfolio-social-btn[data-platform="twitter"]:hover .social-icon { color: #1d9bf0; }
.portfolio-social-btn[data-platform="instagram"]:hover { border-color: #e1306c; color: #e1306c; }
.portfolio-social-btn[data-platform="instagram"]:hover .social-icon { color: #e1306c; }
.portfolio-social-btn[data-platform="github"]:hover   { border-color: var(--text-1); }
.portfolio-social-btn[data-platform="linkedin"]:hover { border-color: #0a66c2; color: #0a66c2; }
.portfolio-social-btn[data-platform="linkedin"]:hover .social-icon { color: #0a66c2; }
.portfolio-social-btn[data-platform="dribbble"]:hover { border-color: #ea4c89; color: #ea4c89; }
.portfolio-social-btn[data-platform="dribbble"]:hover .social-icon { color: #ea4c89; }
.portfolio-social-btn[data-platform="youtube"]:hover  { border-color: #ff0000; color: #ff0000; }
.portfolio-social-btn[data-platform="youtube"]:hover .social-icon { color: #ff0000; }

/* Text-style socials: show the icon inline too */
.portfolio-contact-link .social-icon {
  width: 14px; height: 14px;
  vertical-align: -2px;
  margin-right: 5px;
  color: inherit;
}

/* Avatar centered already via hero align-items:center */
.portfolio-hero-avatar { margin-left: auto; margin-right: auto; }

/* ════════════════════════════════════════════════════════════════
   v5 — full nav-width page (logo → profile-icon). Grid sections fill
   the space; text-heavy sections stay at a readable centered width.
   ════════════════════════════════════════════════════════════════ */

/* Match the nav container (.nav-inner max-width:1600px; padding:0 16px) */
.portfolio {
  max-width: 1600px;
  padding-left: 16px;
  padding-right: 16px;
  /* Tight gap between the meta footer and the global site footer below */
  padding-bottom: 12px;
}

/* Vibes fill the full width — as many ~300px cards as fit per row */
.portfolio-vibes-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
@media (max-width: 760px) { .portfolio-vibes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .portfolio-vibes-grid { grid-template-columns: 1fr; } }

/* Case studies — 2 across on wide screens, centered + constrained */
.portfolio-case-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 760px) { .portfolio-case-list { grid-template-columns: 1fr; } }

/* Text-heavy sections: keep a comfortable reading width, centered */
.portfolio-resume,
.portfolio-skills-row,
.portfolio-achievement-list {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Center the activity heatmap within the wide section */
.streak-grid { width: fit-content; margin-left: auto; margin-right: auto; }
.streak-legend { max-width: fit-content; margin-left: auto; margin-right: auto; }

/* ════════════════════════════════════════════════════════════════
   v6 — widen the centered hero text to use more of the page width.
   ════════════════════════════════════════════════════════════════ */

.portfolio-hero-bio  { max-width: 1040px; }
.portfolio-hero-role { max-width: 900px; }
.portfolio-hero-skills { max-width: 900px; }
.portfolio-stats-row { max-width: 900px; }

/* Slightly larger bio to suit the wider measure */
.portfolio-hero-bio { font-size: 24px; line-height: 1.45; }

/* Avatar upload row in the Edit Profile modal */
.pem-avatar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.pem-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pem-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pem-avatar-fallback {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--portfolio-accent-readable);
}
.pem-avatar-hint { font-size: 12px; color: var(--text-3); margin: 6px 0 0; }

/* Bio in IBM Plex Sans, medium 500 */
.portfolio-hero-bio {
  font-family: 'IBM Plex Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
}

/* Bio +20% (24px -> 29px) */
.portfolio-hero-bio { font-size: 29px; line-height: 1.4; }

/* Bio spans the full page width (logo → profile icon), like the vibe grid */
.portfolio-hero-bio { max-width: none; }

/* Profile name in IBM Plex Sans */
.portfolio-hero-name {
  font-family: 'IBM Plex Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Bio weight 600 */
.portfolio-hero-bio { font-weight: 600; }

/* Bio weight 500, +30% size (29px -> 38px) */
.portfolio-hero-bio { font-weight: 500; font-size: 38px; line-height: 1.35; }

/* Headline: "{role} @ {company}" — IBM Plex Sans light, +30% */
.portfolio-hero-headline {
  font-family: 'IBM Plex Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  font-size: 20px;
  line-height: 1.4;
  color: var(--text-2);
  margin: var(--space-2) 0 0;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Profile name weight 500 */
.portfolio-hero-name { font-weight: 500; }

/* ════════════════════════════════════════════════════════════════
   IBM Plex Sans — elegant weight hierarchy across the portfolio.
   Light for display lines, regular for body, medium for emphasis,
   semibold reserved for small tracked labels. Softer than Inter's
   heavier defaults.
   ════════════════════════════════════════════════════════════════ */

/* Display / identity */
.portfolio-hero-name      { font-weight: 500; letter-spacing: -0.02em; }
.portfolio-hero-headline  { font-weight: 300; }
.portfolio-hero-bio       { font-weight: 500; letter-spacing: -0.01em; }

/* Small tracked section labels — semibold + wider tracking reads refined */
.portfolio-section-heading { font-weight: 600; letter-spacing: 0.18em; }

/* Content titles — medium, not bold */
.portfolio-vibe-title,
.portfolio-case-title,
.portfolio-resume-title,
.portfolio-achievement-title { font-weight: 500; }

/* Body-level text — regular */
.portfolio-vibe-meta,
.portfolio-case-excerpt,
.portfolio-skills-row,
.portfolio-resume-meta,
.portfolio-stat { font-weight: 400; }

/* Stats numbers — semibold, tabular */
.portfolio-stat strong { font-weight: 600; }

/* Pills + buttons — medium */
.portfolio-skill-pill,
.portfolio-social-btn { font-weight: 500; }

/* Url chip — regular handle */
.portfolio-url-chip .url-handle { font-weight: 500; }

/* Profile name weight 600 */
.portfolio-hero-name { font-weight: 600; }

/* Preview mode — hide owner affordances to mimic the visitor view.
   The actions span stays visible (the View button becomes "Exit preview"
   in place); only the Edit button + inline editing affordances hide. */
body.portfolio-previewing #portfolio-edit-btn { display: none !important; }
body.portfolio-previewing [data-empty="1"] { display: none !important; }

/* Bio -20% (38px -> 30px) */
.portfolio-hero-bio { font-size: 30px; }

/* Inline "+ Add" buttons on populated section headers — owner only */
.portfolio-section-add { display: none; }
body.portfolio-is-owner .portfolio-section-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: var(--space-3);
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
body.portfolio-is-owner .portfolio-section-add:hover {
  border-color: var(--text-1);
  color: var(--text-1);
}
/* Hide the add buttons while previewing the visitor view */
body.portfolio-previewing .portfolio-section-add { display: none !important; }
/* Keep the section head from stretching the heading underline weirdly */
.portfolio-section-head { gap: var(--space-2); }

/* ════════════════════════════════════════════════════════════════
   Full-width "+ Add" CTA below a populated section (owner only),
   matching the dashed empty-section placeholder look.
   ════════════════════════════════════════════════════════════════ */
.portfolio-add-cta { display: none; }
body.portfolio-is-owner .portfolio-add-cta {
  display: block;
  width: 100%;
  max-width: 1180px;
  margin: var(--space-4) auto 0;
  padding: var(--space-4);
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
body.portfolio-is-owner .portfolio-add-cta:hover {
  border-color: var(--portfolio-accent-readable);
  color: var(--portfolio-accent-readable);
}
body.portfolio-previewing .portfolio-add-cta { display: none !important; }

/* Case studies: always 2 columns; a single case study spans full width */
.portfolio-case-list { grid-template-columns: repeat(2, 1fr); }
.portfolio-case-list .portfolio-case-card:only-child { grid-column: 1 / -1; }
@media (max-width: 760px) { .portfolio-case-list { grid-template-columns: 1fr; } }

/* Case studies: normal-size cards (max ~560px), 2 across, single card centered.
   auto-fit collapses empty tracks so one card centers; two sit side-by-side. */
.portfolio-case-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 560px));
  justify-content: center;
}
.portfolio-case-list .portfolio-case-card:only-child { grid-column: auto; }
@media (max-width: 760px) { .portfolio-case-list { grid-template-columns: 1fr; } }

/* Full-width "+ Add" CTA below populated sections (owner only) */
body.portfolio-is-owner .portfolio-add-cta {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* ─── Follow button + clickable follower/following counts ─────────── */
.portfolio-follow-btn {
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--portfolio-accent);
  background: var(--portfolio-accent);
  color: var(--portfolio-accent-contrast);
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.portfolio-follow-btn:hover { transform: translateY(-1px); }
.portfolio-follow-btn.following {
  background: var(--surface-1);
  color: var(--text-1);
  border-color: var(--border);
}
.portfolio-follow-btn[hidden] { display: none; }

/* Follower / following counts render as <button> so they open the list modal,
   but should still look exactly like the adjacent .portfolio-stat spans. */
button.portfolio-stat-btn {
  font-family: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button.portfolio-stat-btn:hover { color: var(--text-1); }
button.portfolio-stat-btn:hover strong { text-decoration: underline; }
