/* Portfolio v2 — driven by /assets/project-* exports (screenshots + hero images) */

:root {
  --pv2-font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --pv2-font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --pv2-font-mono: var(--pv2-font-text);
  --pv2-font-chip: var(--pv2-font-text);
  --pv2-asset-shadow: none;
  --pv2-shell-nav-top-bg: #0d0d0e;
  --pv2-shell-nav-bg: rgba(243, 246, 255, 1);
  --pv2-shell-nav-fg: #0d0d0e;
  --pv2-shell-nav-muted: rgba(13, 13, 14, 0.72);
  --pv2-shell-nav-hover: rgba(13, 13, 14, 0.08);
  --pv2-shell-nav-active-bg: transparent;
  --pv2-shell-nav-active-fg: #0d0d0e;
  --pv2-column-surface: rgba(243, 246, 255, 1);
  --pv2-column-ink: #0d0d0e;
  --pv2-asset-bg: #111111;
}

/* Shell: black nav, no “Designer?” */
body.portfolio-v2 {
  --fp-nav-active: #0d0d0e;
  font-family: var(--pv2-font-text);
}

body.portfolio-v2 .left-nav {
  position: relative;
  background: var(--pv2-shell-nav-bg);
  border: 0 solid transparent;
  border-right: 1px solid rgba(0, 0, 0, 1);
  overflow: hidden;
  padding: 0;
  gap: 18px;
  box-sizing: border-box;
}

body.portfolio-v2 .left-nav-brand,
body.portfolio-v2 .left-nav-links {
  position: relative;
  z-index: 1;
}

body.portfolio-v2 .left-nav::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 208px;
  background: var(--pv2-shell-nav-top-bg);
  pointer-events: none;
  z-index: 0;
}

body.portfolio-v2.nav-collapsed .left-nav {
  padding: 0;
  gap: 0;
}

body.portfolio-v2 .left-nav-brand {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--pv2-shell-nav-top-bg);
  padding: 28px 24px 18px;
  box-sizing: border-box;
}

body.portfolio-v2 .left-nav-links {
  padding: 0 24px 40px;
  min-width: 0;
  box-sizing: border-box;
}

body.portfolio-v2 .nav-profile-link {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
  line-height: 0;
  flex: 0 0 auto;
}

body.portfolio-v2 .nav-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.05);
}

body.portfolio-v2 .nav-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.portfolio-v2 a.nav-name {
  font-family: var(--pv2-font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-decoration: none;
  display: block;
  margin: 0;
  line-height: 1.3;
  width: fit-content;
  cursor: pointer;
}

body.portfolio-v2 a.nav-name:hover {
  color: rgba(255, 255, 255, 0.72);
}

body.portfolio-v2 .nav-title {
  display: block;
  font-family: var(--pv2-font-text);
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

body.portfolio-v2 .nav-linkedin {
  font-family: var(--pv2-font-text);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: fit-content;
  margin: 0;
}

body.portfolio-v2 .nav-linkedin:hover {
  color: rgba(255, 255, 255, 0.72);
}

body.portfolio-v2 .nav-list {
  margin-top: 0;
  margin-left: -6px;
  gap: 0px;
}

body.portfolio-v2 .nav-link {
  border-left: none;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--pv2-shell-nav-muted);
  font-family: var(--pv2-font-text);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.2;
}

@media (min-width: 901px) {
  body.portfolio-v2 .left-nav::before {
    display: none;
  }
}

body.portfolio-v2 .nav-link:hover {
  color: var(--pv2-shell-nav-fg);
  background: var(--pv2-shell-nav-hover);
}

body.portfolio-v2 .nav-link--active {
  color: var(--pv2-shell-nav-active-fg);
  font-weight: 700;
  background: var(--pv2-shell-nav-active-bg);
  border-left: none;
}

body.portfolio-v2 .wasd-dock {
  background: rgba(0, 0, 0, 0.98);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.portfolio-v2 .wasd-hint {
  color: #6a6872;
}

body.portfolio-v2 .left-column .collapse-btn {
  background: rgba(0, 0, 0, 0.07);
  color: var(--pv2-body);
  border: none;
}

body.portfolio-v2 .left-column .collapse-btn:hover {
  background: rgba(0, 0, 0, 0.12);
  color: var(--pv2-headline);
}

/* Shared column layout */
body.portfolio-v2 .left-column {
  flex: 0 0 392px;
  min-width: 392px;
  background: rgba(243, 246, 255, 1);
  color: var(--pv2-column-ink);
}

body.portfolio-v2 .left-inner {
  max-width: 392px;
  padding: 72px 48px;
  gap: 28px;
}

/*
 * Right column: isolated assets only (project-*-image*.png), or a .pv2-embed static asset wrapper.
 * Hero images are usually direct children of .right-column--visual — embeds use one wrapper.
 * Centered with theme padding; intrinsic aspect ratio preserved (object-fit: contain).
 */
/* Overrides styles.css .right-column (padding, flex alignment) for portfolio pages */
body.portfolio-v2 .right-column.right-column--visual {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  padding: var(--pv2-visual-py, 56px) var(--pv2-visual-px, 48px);
  overflow: auto;
  box-sizing: border-box;
  align-self: stretch;
  background: var(--pv2-asset-bg);
}

/* Single hero: one img fills available space without stretching past natural bounds */
body.portfolio-v2 .right-column--visual:not(.right-column--visual-pair) > img {
  width: auto;
  height: auto;
  max-width: min(100%, var(--pv2-hero-max-width, 520px));
  max-height: var(--pv2-hero-max-height, min(88vh, 960px));
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0;
  flex: 0 0 auto;
  box-shadow: var(--pv2-asset-shadow);
}

/* Static asset wrapper with a fixed aspect ratio (e.g. project-4) */
body.portfolio-v2 .right-column--visual:not(.right-column--visual-pair) > .pv2-embed {
  width: min(100%, var(--pv2-hero-max-width), calc(var(--pv2-hero-max-height) * var(--pv2-embed-aspect-ratio, 1.3483)));
  aspect-ratio: var(--pv2-embed-aspect, 1378 / 1022);
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: var(--pv2-asset-shadow);
}

body.portfolio-v2 .right-column--visual:not(.right-column--visual-pair) > .pv2-embed .pv2-embed__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
  object-position: center;
  z-index: 2;
}

/* Two heroes side by side (Compression) — still no wrapper, two sibling imgs */
body.portfolio-v2 .right-column--visual-pair {
  gap: var(--pv2-pair-gap, 28px);
}

body.portfolio-v2 .right-column--visual-pair > img {
  width: auto;
  height: auto;
  max-width: min(var(--pv2-pair-item-max-width, 360px), calc(50% - var(--pv2-pair-gap, 28px) / 2));
  max-height: var(--pv2-pair-max-height, min(86vh, 940px));
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0;
  flex: 0 1 auto;
  box-shadow: var(--pv2-asset-shadow);
}

@media (max-width: 800px) {
  body.portfolio-v2 .right-column--visual-pair > img {
    max-width: min(100%, var(--pv2-pair-item-max-width, 360px));
  }
}

/* Typography blocks */
.pv2-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.pv2-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: var(--pv2-font-chip);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
}

.pv2-tag--solid {
  background: var(--pv2-tag-solid-bg);
  color: var(--pv2-tag-solid-fg);
}

.pv2-tag--soft {
  background: var(--pv2-tag-soft-bg);
  color: var(--pv2-tag-soft-fg);
  border: 1px solid var(--pv2-tag-soft-border, transparent);
  font-weight: 500;
}

.pv2-headline {
  font-family: var(--pv2-font-display);
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--pv2-headline);
}

.pv2-body {
  font-family: var(--pv2-font-text);
  font-size: 15px;
  color: var(--pv2-body);
  margin: 0;
}

.pv2-body p {
  margin: 0 0 14px;
  line-height: 1.55;
}

.pv2-body a.pv2-inline-link {
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: inherit;
  font-weight: 500;
}

.pv2-list {
  margin: 0;
  padding-left: 1.15rem;
  font-family: var(--pv2-font-text);
  font-size: 14px;
  line-height: 20px;
  color: var(--pv2-body);
}

.pv2-list li {
  margin-bottom: 4px;
}

.pv2-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.pv2-metric,
.pv2-highlight-chip {
  display: inline-flex;
  padding: 7px 12px;
  font-family: var(--pv2-font-chip);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  background: var(--pv2-metric-bg);
  color: var(--pv2-metric-fg);
}

.pv2-outline-btn {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  font-family: var(--pv2-font-chip);
  font-size: 12px;
  font-weight: 600;
  color: var(--pv2-outline-fg);
  border: 1px solid var(--pv2-outline-border);
  border-radius: 8px;
  background: var(--pv2-asset-bg);
  margin-top: 4px;
  cursor: default;
}

.pv2-outline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* --- Dynamic Prototyping (project-1) --- */
body.fp-v2-dynamic {
  --pv2-nav-active: #ffeadc;
  --pv2-headline: #5c3317;
  --pv2-body: #5c3317;
  --pv2-column-surface: #fff5ee;
  --pv2-asset-bg: rgba(255, 199, 199, 1);
  --pv2-tag-solid-bg: #5c3317;
  --pv2-tag-solid-fg: #fff5ee;
  --pv2-tag-soft-bg: #f5dcc8;
  --pv2-tag-soft-fg: #5c3317;
  --pv2-metric-bg: #f5dcc8;
  --pv2-metric-fg: #5c3317;
  --pv2-outline-fg: #5c3317;
  --pv2-outline-border: #5c3317;
  --pv2-visual-py: 64px;
  --pv2-visual-px: 56px;
  --pv2-hero-max-width: 420px;
  --pv2-hero-max-height: min(92vh, 980px);
  --pv2-asset-shadow: 0 24px 48px -8px rgba(92, 51, 23, 0.14);
}

body.fp-v2-dynamic .left-column {
  background: var(--pv2-column-surface);
}

body.fp-v2-dynamic .right-column--visual {
  background: var(--pv2-asset-bg);
}

/* --- Clarity Tooling (project-2) --- */
body.fp-v2-tooling {
  --pv2-nav-active: #fde3ff;
  --pv2-headline: #4a0d52;
  --pv2-body: #6b2f75;
  --pv2-column-surface: #fde8ff;
  --pv2-asset-bg: rgba(206, 173, 255, 1);
  --pv2-tag-solid-bg: #54015b;
  --pv2-tag-solid-fg: #fde6ff;
  --pv2-tag-soft-bg: #f7d7fa;
  --pv2-tag-soft-fg: #54015b;
  --pv2-tag-soft-border: rgba(84, 1, 91, 0.35);
  --pv2-metric-bg: #f7d7fa;
  --pv2-metric-fg: #54015b;
  --pv2-outline-fg: #54015b;
  --pv2-outline-border: #54015b;
  --pv2-visual-py: 56px;
  --pv2-visual-px: 48px;
  --pv2-hero-max-width: min(96vw, 1020px);
  --pv2-hero-max-height: min(78vh, 1180px);
  --pv2-asset-shadow: 64px 64px 104px 0px rgba(74, 13, 82, 0.24);
}

body.fp-v2-tooling .left-column {
  background: var(--pv2-column-surface);
}

body.fp-v2-tooling .right-column--visual {
  background: var(--pv2-asset-bg);
}

body.portfolio-v2 .right-column.right-column--embed {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  align-self: stretch;
  background: var(--pv2-asset-bg);
}

/* Dynamic project (project-1): PalmTech screenshot — no embed-wrapper / scaler DOM */
body.portfolio-v2.fp-v2-dynamic .right-column.right-column--embed {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  box-sizing: border-box;
}

body.portfolio-v2.fp-v2-dynamic .right-column.right-column--embed > img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 502px);
  max-height: min(calc(100vh - 96px), 1092px);
  object-fit: contain;
  object-position: center top;
  border-radius: 24px;
  box-shadow: var(--pv2-asset-shadow);
  background: transparent;
}

@media (max-width: 900px) {
  body.portfolio-v2.fp-v2-dynamic .right-column.right-column--embed {
    padding: 24px 20px;
  }

  body.portfolio-v2.fp-v2-dynamic .right-column.right-column--embed > img {
    max-height: min(78vh, 1092px);
  }
}

body.fp-v2-tooling .right-column--embed {
  background: var(--pv2-asset-bg);
}

body.fp-v2-tooling .right-column--embed .embed-wrapper .embed-scaler img {
  box-shadow: var(--pv2-asset-shadow);
}

/* --- Compression (project-3) — lime active nav */
body.fp-v2-compressor {
  --pv2-nav-active: #d4f2a6;
  --pv2-headline: #1b3005;
  --pv2-body: #1b3005;
  --pv2-column-surface: #f0fde0;
  --pv2-asset-bg: rgba(114, 142, 253, 1);
  --pv2-tag-solid-bg: #1b3005;
  --pv2-tag-solid-fg: #f0fde0;
  --pv2-tag-soft-bg: #d4e8b8;
  --pv2-tag-soft-fg: #1b3005;
  --pv2-metric-bg: #d4e8b8;
  --pv2-metric-fg: #1b3005;
  --pv2-outline-fg: #1b3005;
  --pv2-outline-border: #1b3005;
  --pv2-visual-py: 56px;
  --pv2-visual-px: 40px;
  --pv2-pair-gap: 28px;
  --pv2-pair-item-max-width: 360px;
  --pv2-pair-max-height: min(88vh, 960px);
  --pv2-asset-shadow: 0 24px 48px -8px rgba(27, 48, 5, 0.14);
}

body.fp-v2-compressor .left-column {
  background: var(--pv2-column-surface);
}

body.fp-v2-compressor .right-column--visual {
  background: var(--pv2-asset-bg);
}

/* --- Calendar (project-4) --- */
body.fp-v2-calendar {
  --pv2-nav-active: #e1ecff;
  --pv2-headline: #001b44;
  --pv2-body: #001b44;
  --pv2-column-surface: #e1ecff;
  --pv2-asset-bg: rgba(77, 178, 255, 1);
  --pv2-tag-solid-bg: #0a2a6b;
  --pv2-tag-solid-fg: #e1ecff;
  --pv2-tag-soft-bg: #c5d7f5;
  --pv2-tag-soft-fg: #001b44;
  --pv2-metric-bg: #c5d7f5;
  --pv2-metric-fg: #001b44;
  --pv2-outline-fg: #001b44;
  --pv2-outline-border: #001b44;
  --pv2-visual-py: 48px;
  --pv2-visual-px: 44px;
  --pv2-hero-max-width: min(96vw, 1280px);
  --pv2-hero-max-height: min(76vh, 920px);
  --pv2-asset-shadow: 0 24px 48px -8px rgba(0, 27, 68, 0.14);
}

body.fp-v2-calendar .left-column {
  background: var(--pv2-column-surface);
}

body.fp-v2-calendar .right-column--visual {
  background: var(--pv2-asset-bg);
}

body.fp-v2-calendar .pv2-tag--soft {
  border: 1px solid rgba(0, 27, 68, 0.22);
}

body.fp-v2-calendar .pv2-subline {
  font-family: var(--pv2-font-text);
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: var(--pv2-body);
  margin: 0 0 12px;
}

body.fp-v2-creative {
  --pv2-nav-active: #e879f9;
  --pv2-column-surface: #fce4ff;
  --pv2-asset-bg: #f4f6ff;
}

body.fp-v2-creative .left-column.creative-index-column {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  background: var(--pv2-column-surface);
  border: 0;
  border-right: 1px solid rgba(0, 0, 0, 1);
}

body.fp-v2-creative .left-inner.creative-index-inner {
  max-width: 200px;
  width: fit-content;
  align-self: flex-start;
  padding: 32px 24px 64px;
  gap: 36px;
}

body.fp-v2-creative .creative-index-inner .creative-index-header,
body.fp-v2-creative .creative-index-inner .creative-work-list {
  width: fit-content;
  max-width: 100%;
}

body.fp-v2-creative .creative-index-column .creative-work-list {
  align-items: flex-start;
}

body.fp-v2-creative .creative-index-column .creative-work-link {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.creative-index-header {
  display: flex;
  flex-direction: column;
  gap: 48px;
  width: 100%;
}

.creative-index-title {
  margin: 0;
  font-family: var(--pv2-font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: #4a1d5c;
}

.creative-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.creative-filter {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(74, 29, 92, 0.08);
  color: #6b4f75;
  font-family: var(--pv2-font-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.creative-filter:hover {
  background: rgba(74, 29, 92, 0.14);
}

.creative-filter--active {
  background: #4a1d5c;
  color: #ffffff;
  font-weight: 600;
}

.creative-work-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: stretch;
  width: 100%;
}

/* Match main shell nav links (body.portfolio-v2 .nav-link) */
.creative-work-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-left: none;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--pv2-shell-nav-muted);
  font-family: var(--pv2-font-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}

.creative-work-link:hover {
  color: var(--pv2-shell-nav-fg);
  background: var(--pv2-shell-nav-hover);
}

.creative-work-link--active {
  color: var(--pv2-shell-nav-active-fg);
  font-weight: 700;
  background: var(--pv2-shell-nav-active-bg);
  border-left: none;
}

.creative-work-link--hidden,
.creative-work-panel--hidden {
  display: none !important;
}

body.portfolio-v2 .right-column.right-column--creative-work {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-self: stretch;
  display: block;
  background: var(--pv2-asset-bg);
  scroll-behavior: smooth;
  --creative-dock-height: 104px;
  scroll-padding-top: var(--creative-dock-height);
}

.creative-work-panel {
  position: relative;
  min-height: 0;
  scroll-margin-top: var(--creative-dock-height);
  background: var(--pv2-asset-bg);
  color: #191919;
  outline: none;
}

/* Per-panel heroes stay in DOM for titles & variants; visible chrome is #creative-work-dock */
.creative-work-panel > .creative-work-hero {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.creative-work-hero--dock {
  position: sticky;
  top: 0;
  z-index: 3;
  flex-shrink: 0;
}

#work-guardian {
  background-color: #ecf2ff;
  border-left: 1px solid #000000;
}

.creative-work-hero {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 36px 56px 36px 48px;
  background-color: rgba(162, 28, 175, 0.96);
  color: #ffffff;
}

.creative-work-hero h2 {
  margin: 0;
  font-family: var(--pv2-font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.creative-work-hero span {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: var(--pv2-font-chip);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

body.fp-v2-creative .right-column--creative-work .creative-work-hero {
  background-color: rgba(25, 25, 25, 1);
}

.creative-work-canvas {
  padding: 72px;
}

.creative-work-canvas--palmtech {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.creative-palmtech-logo,
.creative-palmtech-lockup {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

.creative-palmtech-logo {
  height: 227px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.creative-palmtech-logo img {
  width: 155px;
  height: auto;
  display: block;
}

.creative-palmtech-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.creative-palmtech-lockup img {
  width: min(280px, 100%);
  height: auto;
  display: block;
}

.creative-work-canvas--media {
  padding: 72px;
}

.creative-work-canvas--media img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 0;
  border-radius: 12px;
  display: block;
  background: #111111;
}

.creative-work-gallery {
  padding: 72px;
  display: grid;
  gap: 24px;
}

.creative-work-gallery img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 12px;
  background: #ffffff;
}

.creative-work-gallery--four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.creative-work-gallery--feature {
  grid-template-columns: minmax(220px, 0.65fr) minmax(320px, 1.35fr);
  align-items: stretch;
}

.creative-work-gallery--masonry {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creative-work-gallery--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creative-work-gallery--icons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#work-icons .creative-work-gallery--icons .creative-icon-enlarge {
  display: block;
  min-height: 0;
  align-self: start;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  cursor: zoom-in;
  outline: none;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.15s ease;
}

#work-icons .creative-work-gallery--icons .creative-icon-enlarge:hover {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

#work-icons .creative-work-gallery--icons .creative-icon-enlarge:focus-visible {
  box-shadow: 0 0 0 2px var(--pv2-nav-active, #e879f9);
}

#work-icons .creative-work-gallery--icons img {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: unset;
  object-position: unset;
  background: transparent;
}

/* Anchored to .right-column--creative-work so the preview stays in the third column, not the full viewport */
.creative-icon-lightbox {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.88);
}

.creative-icon-lightbox[hidden] {
  display: none;
}

.creative-icon-lightbox__inner {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.creative-icon-lightbox__inner img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.creative-icon-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #191919;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.creative-icon-lightbox__close:hover {
  background: #ffffff;
}

.creative-work-gallery--four img,
.creative-work-gallery--feature img,
.creative-work-gallery--three img {
  aspect-ratio: 1 / 1;
}

.creative-work-gallery--masonry img {
  aspect-ratio: 4 / 5;
}

#work-nacha .creative-work-gallery--masonry {
  grid-template-columns: 1fr;
}

#work-slack .creative-work-gallery--four {
  grid-template-columns: 1fr;
}

#work-slack .creative-work-gallery--four > img {
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

#work-retreat .creative-work-gallery--three {
  grid-template-columns: 1fr;
}

#work-retreat .creative-work-gallery--three > img {
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

#work-company .creative-work-gallery--three {
  grid-template-columns: 1fr;
}

#work-company .creative-work-gallery--three > img {
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

@media (max-width: 1100px) {
  body.fp-v2-creative .left-inner.creative-index-inner {
    padding: 28px 24px 48px;
  }

  .creative-work-canvas,
  .creative-work-canvas--media,
  .creative-work-gallery {
    padding: 48px;
  }
}

@media (max-width: 900px) {
  body.fp-v2-creative .left-column.creative-index-column {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  body.fp-v2-creative .left-inner.creative-index-inner {
    padding: 40px 24px;
  }

  .creative-index-header {
    gap: 24px;
  }

  body.portfolio-v2 .right-column.right-column--creative-work {
    height: auto;
    min-height: 0;
    overflow: visible;
    --creative-dock-height: 92px;
  }

  .creative-work-panel {
    min-height: 0;
  }

  .creative-work-hero {
    padding: 28px 32px;
  }

  body.portfolio-v2 .right-column.right-column--creative-work .creative-work-hero--dock {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .creative-work-canvas,
  .creative-work-canvas--media,
  .creative-work-gallery {
    padding: 32px;
  }

  .creative-work-gallery--four,
  .creative-work-gallery--feature,
  .creative-work-gallery--masonry,
  .creative-work-gallery--three,
  .creative-work-gallery--icons {
    grid-template-columns: 1fr;
  }
}

/* --- Chords & Stuff / Chord Flow (project-6) */
body.fp-v2-chords {
  --pv2-nav-active: #c9a227;
  --pv2-headline: #2a2318;
  --pv2-body: #3d3428;
  --pv2-column-surface: #faf6ef;
  --pv2-asset-bg: rgba(31, 31, 31, 1);
  --pv2-outline-asset-fg: #faf6ef;
  --pv2-outline-asset-border: rgba(250, 246, 239, 0.88);
  --pv2-tag-solid-bg: #2a2318;
  --pv2-tag-solid-fg: #faf6ef;
  --pv2-tag-soft-bg: #ebe3d4;
  --pv2-tag-soft-fg: #2a2318;
  --pv2-tag-soft-border: rgba(42, 35, 24, 0.25);
  --pv2-metric-bg: #ebe3d4;
  --pv2-metric-fg: #2a2318;
  --pv2-outline-fg: #2a2318;
  --pv2-outline-border: #2a2318;
  --pv2-visual-py: 56px;
  --pv2-visual-px: 48px;
  --pv2-hero-max-width: min(96vw, 1020px);
  --pv2-hero-max-height: min(78vh, 1180px);
  --pv2-asset-shadow: 0 24px 56px -12px rgba(42, 35, 24, 0.2);
}

body.fp-v2-chords .left-column {
  background: var(--pv2-column-surface);
}

body.fp-v2-chords .right-column--embed {
  background: var(--pv2-asset-bg);
}

body.fp-v2-chords .right-column--embed .embed-wrapper .embed-scaler img {
  box-shadow: var(--pv2-asset-shadow);
}

/* --- React Native visual editor (project-7) */
body.fp-v2-rn-editor {
  --pv2-nav-active: #38bdf8;
  --pv2-headline: #0c1e2e;
  --pv2-body: #1a3a52;
  --pv2-column-surface: #e8f4fc;
  --pv2-asset-bg: rgba(193, 166, 242, 1);
  --pv2-tag-solid-bg: #0c4a6e;
  --pv2-tag-solid-fg: #e0f2fe;
  --pv2-tag-soft-bg: #bae6fd;
  --pv2-tag-soft-fg: #0c4a6e;
  --pv2-tag-soft-border: rgba(12, 74, 110, 0.28);
  --pv2-metric-bg: #bae6fd;
  --pv2-metric-fg: #0c4a6e;
  --pv2-outline-fg: #0c4a6e;
  --pv2-outline-border: #0c4a6e;
  --pv2-visual-py: 48px;
  --pv2-visual-px: 40px;
  --pv2-hero-max-width: min(100%, 720px);
  --pv2-hero-max-height: min(82vh, 920px);
  --pv2-asset-shadow: 0 24px 48px -8px rgba(12, 74, 110, 0.18);
}

body.fp-v2-rn-editor .left-column {
  background: var(--pv2-column-surface);
}

body.fp-v2-rn-editor .right-column--visual {
  background: var(--pv2-asset-bg);
}

/* Case-study highlight line — same chip treatment as .pv2-metric */
.pv2-highlight-chip {
  margin: 0;
  max-width: 100%;
}

.pv2-code-inline {
  font-family: var(--pv2-font-text);
  font-size: 11px;
  font-weight: 600;
  word-break: break-all;
}

body.portfolio-v2 .right-column--visual > video.pv2-demo-video,
body.portfolio-v2 .right-column--visual > img.pv2-demo-still {
  width: auto;
  height: auto;
  max-width: min(100%, var(--pv2-hero-max-width, 720px));
  max-height: var(--pv2-hero-max-height, min(88vh, 960px));
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0;
  flex: 0 0 auto;
  box-shadow: var(--pv2-asset-shadow);
  border: 1px solid rgba(12, 74, 110, 0.12);
  border-radius: 8px;
  background: #0c1220;
}

body.portfolio-v2 .right-column--visual.right-column--rn-demo {
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1180px) and (min-width: 901px) {
  body.portfolio-v2 .left-nav {
    flex-basis: 156px;
    min-width: 156px;
  }

  body.portfolio-v2 .left-nav-brand {
    padding: 28px 20px 18px;
  }

  body.portfolio-v2 .left-nav-links {
    padding: 0 20px 40px;
  }

  body.portfolio-v2 .left-column {
    flex-basis: 336px;
    min-width: 336px;
  }

  body.portfolio-v2 .left-inner {
    padding: 56px 32px;
  }

  body.portfolio-v2 .right-column.right-column--visual {
    padding: var(--pv2-visual-py, 44px) var(--pv2-visual-px, 32px);
  }
}

@media (max-width: 900px) {
  html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.portfolio-v2 {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.portfolio-v2 .layout {
    min-height: 100svh;
    overflow-x: hidden;
  }

  body.portfolio-v2 .left-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    flex: 0 0 auto;
    flex-basis: auto;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    /* Let the sticky header grow with wrapped/scrolling links; capped so it never dominates the viewport */
    max-height: min(50vh, 360px);
    overflow: visible;
    background: var(--pv2-shell-nav-bg);
    backdrop-filter: blur(12px);
  }

  /* Full-band dark tint so nav links stay on the same ink as desktop top strip */
  body.portfolio-v2 .left-nav::before {
    display: block;
    inset: 0;
    height: 100%;
  }

  body.portfolio-v2 .left-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 12px;
    min-height: 0;
  }

  body.portfolio-v2 .left-nav-brand {
    background: transparent;
    padding: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "avatar identity"
      "links links";
    gap: 10px 14px;
    min-width: 0;
  }

  body.portfolio-v2 .left-nav-links {
    padding: 0;
    width: 100%;
    min-width: 0;
  }

  body.portfolio-v2 .nav-profile-link {
    grid-area: avatar;
    width: 44px;
    height: 44px;
  }

  body.portfolio-v2 .nav-identity {
    grid-area: identity;
    align-self: center;
  }

  body.portfolio-v2 .nav-linkedin {
    grid-area: links;
    margin: 0;
    font-size: 13px;
  }

  body.portfolio-v2 .nav-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 2px 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.portfolio-v2 .nav-list::-webkit-scrollbar {
    display: none;
  }

  body.portfolio-v2 .nav-list li,
  body.portfolio-v2 .nav-list .nav-list-group {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
  }

  body.portfolio-v2 .nav-link {
    white-space: nowrap;
    font-size: 13px;
    padding: 7px 10px;
    /* Sidebar uses dark ink on pale bg; mobile strip sits on nav-top (::before), so links must stay light */
    color: rgba(255, 255, 255, 0.78);
  }

  body.portfolio-v2 .nav-list .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
  }

  body.portfolio-v2 .nav-list .nav-link--active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    font-weight: 700;
  }

  body.portfolio-v2 .creative-work-link {
    font-size: 13px;
    padding: 7px 10px;
  }

  body.portfolio-v2 .left-column {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.portfolio-v2 .left-inner {
    max-width: none;
    width: 100%;
    padding: 40px clamp(20px, 6vw, 48px);
  }

  body.portfolio-v2 .pv2-headline,
  body.portfolio-v2 .pv2-body,
  body.portfolio-v2 .pv2-subline,
  body.portfolio-v2 .pv2-highlight-chip {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  body.portfolio-v2 .pv2-headline {
    font-size: clamp(30px, 10vw, 42px);
  }

  body.portfolio-v2.fp-v2-calendar .pv2-headline {
    font-size: clamp(28px, 8vw, 42px);
  }

  body.portfolio-v2 .right-column.right-column--visual {
    width: 100%;
    min-height: clamp(360px, 68svh, 720px);
    padding: 32px clamp(16px, 5vw, 40px);
    overflow: visible;
  }

  body.portfolio-v2 .right-column--visual:not(.right-column--visual-pair) > img,
  body.portfolio-v2 .right-column--visual > img.pv2-demo-still,
  body.portfolio-v2 .right-column--visual > video.pv2-demo-video {
    width: min(100%, var(--pv2-hero-max-width, 720px));
    max-width: 100%;
    max-height: min(70svh, var(--pv2-hero-max-height, 920px));
  }

  body.portfolio-v2 .right-column--visual:not(.right-column--visual-pair) > .pv2-embed {
    width: 100%;
    max-width: var(--pv2-hero-max-width, 720px);
  }
}

@media (max-width: 560px) {
  body.portfolio-v2 .left-nav {
    gap: 8px;
    padding: 12px 14px 10px;
  }

  body.portfolio-v2 .left-nav-brand {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px 12px;
  }

  body.portfolio-v2 .left-nav {
    max-height: min(48vh, 340px);
  }

  body.portfolio-v2 .nav-profile-link {
    width: 36px;
    height: 36px;
  }

  body.portfolio-v2 a.nav-name,
  body.portfolio-v2 .nav-title {
    font-size: 12px;
  }

  body.portfolio-v2 .nav-link {
    font-size: 12px;
    padding: 7px 9px;
  }

  body.portfolio-v2 .creative-work-link {
    font-size: 12px;
    padding: 7px 9px;
  }

  body.portfolio-v2 .left-inner {
    padding: 32px 20px;
  }

  body.portfolio-v2 .right-column.right-column--visual {
    min-height: 56svh;
    padding: 24px 16px;
  }
}

/* --- Home page (fp-v2-home) — intro column + peek preview grid ---------- */
body.fp-v2-home {
  --pv2-nav-active: #ffffff;
  --pv2-headline: #0d0d0e;
  --pv2-body: #0d0d0e;
}

body.fp-v2-home .left-column.home-column {
  background: rgba(243, 246, 255, 1);
  flex: 0 0 520px;
  min-width: 420px;
  max-width: 560px;
}

body.fp-v2-home .left-inner.home-inner {
  padding: 80px 72px 80px 64px;
  gap: 28px;
  max-width: none;
}

.home-hello {
  font-family: var(--pv2-font-display);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #0d0d0e;
  margin: 0 0 8px;
}

.home-body {
  font-family: var(--pv2-font-text);
  font-size: 15px;
  line-height: 1.55;
  color: #0d0d0e;
  margin: 0;
}

.home-body--muted {
  color: #0d0d0e;
}

/* Right pane: 2×3 bento (Figma Frame 2183 — 701×774, six cells ~350.5×258) */
body.fp-v2-home .right-column--home-grid {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: #ffffff;
  overflow: hidden;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.home-preview-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.home-preview-tile {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  container-type: size;
  overflow: hidden;
  text-decoration: none;
  transition: z-index 0.2s ease, box-shadow 0.2s ease;
}

/* Home preview assets are positioned to match the 2x3 reference composition. */
body.fp-v2-home .home-preview-tile--pv2-dynamic {
  background: #fff5ee;
  --home-preview-img-width: 90%;
  --home-preview-img-left: 12%;
  --home-preview-img-top: -2%;
  --home-preview-img-shadow: drop-shadow(0 28px 48px rgba(92, 51, 23, 0.18));
}

body.fp-v2-home .home-preview-tile--pv2-compressor {
  background: #e8f8d4;
  --home-preview-img-width: 124%;
  --home-preview-img-left: -12%;
  --home-preview-img-top: 5%;
  --home-preview-img-shadow: drop-shadow(0 28px 48px rgba(27, 48, 5, 0.18));
}

body.fp-v2-home .home-preview-tile--pv2-tooling {
  background: #fde8ff;
  --home-preview-img-width: 100%;
  --home-preview-img-left: 0;
  --home-preview-img-top: 17%;
  --home-preview-img-shadow: drop-shadow(32px 44px 48px rgba(74, 13, 82, 0.24));
}

body.fp-v2-home .home-preview-tile--pv2-calendar {
  background: #e1ecff;
  --home-preview-img-width: 100%;
  --home-preview-img-left: 0;
  --home-preview-img-top: 18%;
  --home-preview-img-shadow: drop-shadow(0 34px 52px rgba(0, 27, 68, 0.2));
}

body.fp-v2-home .home-preview-tile--pv2-rn-editor {
  background: #fbfced;
  --home-preview-img-width: 94%;
  --home-preview-img-left: 3%;
  --home-preview-img-top: 18%;
  --home-preview-img-shadow: drop-shadow(0 28px 44px rgba(53, 60, 18, 0.16));
}

body.fp-v2-home .home-preview-tile--pv2-creative {
  background: rgba(244, 246, 255, 1);
  --home-preview-img-shadow: none;
}

body.fp-v2-home .home-preview-tile--pv2-creative .home-preview-tile__inset {
  background-color: rgba(255, 255, 255, 1);
  padding: 0;
}

body.fp-v2-home .home-preview-tile--pv2-creative .home-preview-tile__inset img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
}

.home-preview-tile__inset {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: rgba(255, 255, 255, 1);
}

.home-preview-tile--asset-portrait .home-preview-tile__inset {
  padding: 0;
}

.home-preview-tile--asset-landscape .home-preview-tile__inset {
  padding: 0;
}

.home-preview-tile:focus-visible {
  z-index: 1;
  box-shadow: 0 0 0 2px #0a0a0a inset;
}

.home-preview-tile__inset img {
  position: absolute;
  top: var(--home-preview-img-top, 0);
  left: var(--home-preview-img-left, 0);
  width: var(--home-preview-img-width, 100%);
  height: var(--home-preview-img-height, auto);
  max-width: none;
  max-height: none;
  object-fit: var(--home-preview-img-object-fit, contain);
  object-position: var(--home-preview-img-object-position, center);
  display: block;
  filter: var(--home-preview-img-shadow, none);
  box-shadow: none;
  pointer-events: none;
  transform: var(--home-preview-img-transform, scale(1));
  transform-origin: var(--home-preview-img-transform-origin, center);
  transition: transform 0.45s ease;
}

.home-preview-tile:hover .home-preview-tile__inset img {
  transform: var(--home-preview-img-transform, scale(1)) scale(1.04);
}

@media (max-width: 900px) {
  body.fp-v2-home .left-column.home-column {
    flex: none;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  body.fp-v2-home .left-inner.home-inner {
    padding: 48px clamp(20px, 6vw, 40px);
  }

  .home-hello {
    font-size: clamp(26px, 6vw, 34px);
  }

  body.fp-v2-home .right-column--home-grid {
    min-height: 78svh;
    overflow: visible;
  }

  .home-preview-grid {
    min-height: 78svh;
    grid-template-rows: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 560px) {
  body.fp-v2-home .left-inner.home-inner {
    padding: 36px 20px;
  }

  .home-hello {
    font-size: clamp(22px, 7.6vw, 30px);
  }

  .home-body {
    font-size: 13px;
  }

  .home-preview-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, minmax(220px, 42svh));
  }

  body.fp-v2-home .right-column--home-grid {
    min-height: 0;
  }
}

/* Final shell color overrides from the redesign reference. Keep after page themes. */
body.portfolio-v2 .left-column,
body.fp-v2-home .left-column.home-column,
body.fp-v2-creative .left-column.creative-index-column {
  background: rgba(243, 246, 255, 1);
  color: #0d0d0e;
}

body.portfolio-v2 .left-column :where(h1, h2, h3, p, li, span, button),
body.portfolio-v2 .left-column a:not(.creative-work-link) {
  color: #0d0d0e;
}

body.portfolio-v2 .left-column :where(.pv2-tag, .pv2-metric, .pv2-outline-btn, .pv2-highlight-chip, .creative-filter) {
  background: rgba(13, 13, 14, 0.08);
  border-color: rgba(13, 13, 14, 0.16);
  color: #0d0d0e;
}

body.portfolio-v2 .left-column .pv2-outline-btn {
  width: fit-content;
  background: var(--pv2-asset-bg);
  border: 1px solid var(--pv2-outline-asset-border, var(--pv2-outline-border));
  color: var(--pv2-outline-asset-fg, var(--pv2-outline-fg));
}

body.portfolio-v2 .left-column :is(.pv2-metric, .pv2-highlight-chip, .pv2-tag--soft) {
  width: fit-content;
  background: unset;
  border: 1px solid rgba(13, 13, 14, 1);
  color: rgba(14, 14, 14, 1);
}

body.portfolio-v2 .left-column .embed-standalone-link {
  width: fit-content;
  background: unset;
  border: 1px solid rgba(13, 13, 14, 1);
  color: rgba(14, 14, 14, 1);
}

body.portfolio-v2 .left-column :where(.pv2-tag--solid, .creative-filter--active) {
  background: #0d0d0e;
  border-color: #0d0d0e;
  color: #ffffff;
}
